Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improving documentation of models.encodings.entangling_layer #1273

Merged
merged 11 commits into from
Mar 22, 2024
Binary file added doc/source/_static/entangling_layer.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 21 additions & 0 deletions doc/source/api-reference/qibo.rst
Original file line number Diff line number Diff line change
Expand Up @@ -390,6 +390,26 @@ Entangling layer
""""""""""""""""

Generates a layer of nearest-neighbour two-qubit gates, assuming 1-dimensional connectivity.
With the exception of :class:`qibo.gates.gates.GeneralizedfSim`,
can be set to any of the two-qubit gates implemented in ``qibo``.
renatomello marked this conversation as resolved.
Show resolved Hide resolved
If the chosen gate is parametrized, all phases are set to :math:`0.0`.
Note that these phases can be updated a posterior by using
:meth:`qibo.models.Circuit.set_parameters`.
There are four possible choices of layer ``architechture``:
renatomello marked this conversation as resolved.
Show resolved Hide resolved
``diagonal``, ``shifted``, ``even-layer``, and ``odd-layer``.
For instance, we show below an example of each architecture for ``nqubits = 6``.


.. image:: ../_static/entangling_layer.png
:width: 2500px
:height: 1552px
:scale: 30 %
:align: center


If ``closed_boundary`` is set to ``True``, then an extra gate is added connecting the last and the first qubit,
with the last qubit as the control qubit and the first qubit as a target qubit.


.. autofunction:: qibo.models.encodings.entangling_layer

Expand Down Expand Up @@ -1627,6 +1647,7 @@ We provide integration with the `stim <https://github.com/quantumlib/Stim>`_ pac
It is possible to run Clifford circuits using `stim` as an engine:

.. code-block:: python

from qibo.backends import CliffordBackend
from qibo.quantum_info import Clifford, random_clifford

Expand Down
Loading