Skip to content

Commit

Permalink
Merge pull request #147 from BoxiLi/restructure_circuit2
Browse files Browse the repository at this point in the history
Restructure the circuit module

- Split `circuit.py` into a subpackage.
- Move `Measurement` and `Gate` to `qutip_qip.operations`.
- Move the core part of `gate_sequence_product` to `qutip_qip.circuit`. They can be improved as part of the gate-level simulation in a different PR.

Only moving things around. No change to the code is made except for the deprecation warnings.
  • Loading branch information
BoxiLi committed Jun 29, 2022
2 parents daed76a + 352d530 commit 3c22d71
Show file tree
Hide file tree
Showing 25 changed files with 2,946 additions and 2,867 deletions.
1 change: 0 additions & 1 deletion doc/source/apidoc/qutip_qip.circuit.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,3 @@ qutip\_qip.circuit
QubitCircuit
CircuitResult
CircuitSimulator
Measurement
1 change: 1 addition & 0 deletions doc/source/apidoc/qutip_qip.operations.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ qutip\_qip.operations
.. autosummary::

Gate
Measurement
GATE_CLASS_MAP
X
Y
Expand Down
6 changes: 3 additions & 3 deletions doc/source/qip-basics.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ The circuit is characterized by registers and gates:
and the argument ``num_cbits`` (optional) specifies the number of classical bits available for measurement
and control.

- **Gates**: Each quantum gate is saved as a class object :class:`.Gate`
- **Gates**: Each quantum gate is saved as a class object :class:`~.operations.Gate`
with information such as gate name, target qubits and arguments.
Gates can also be controlled on a classical bit by specifying the register number
with the argument ``classical_controls``.

- **Measurements**: We can also carry out measurements on individual qubit (both in the middle and at the end of the circuit).
Each measurement is saved as a class object :class:`.Measurement` with parameters such as `targets`,
Each measurement is saved as a class object :class:`~.operations.Measurement` with parameters such as `targets`,
the target qubit on which the measurement will be carried out, and `classical_store`,
the index of the classical register which stores the result of the measurement.

Expand Down Expand Up @@ -135,7 +135,7 @@ can be achieved with the argument ``expand=False`` specified to the
Gates
=====

The pre-defined gates for the class :class:`.Gate` are shown in the table below:
The pre-defined gates for the class :class:`~.operations.Gate` are shown in the table below:

==================== ========================================
Gate name Description
Expand Down

0 comments on commit 3c22d71

Please sign in to comment.