Skip to content

Commit

Permalink
fix: circuit docstring
Browse files Browse the repository at this point in the history
  • Loading branch information
changsookim committed Nov 28, 2024
1 parent dc9bece commit e485312
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions src/qibo/models/circuit.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,17 @@ class Circuit:
A specific backend has to be used for performing calculations.
Circuits can be created with a specific number of qubits and wire names.
- Either ``nqubits`` or ``wire_names`` must be provided.
- If only ``nqubits`` is provided, wire names will default to ``[0, 1, ..., nqubits - 1]``.
- If only ``wire_names`` is provided, ``nqubits`` will be set to the length of ``wire_names``.
- ``nqubits`` and ``wire_names`` must be consistent with each other.
Example:
.. testcode::
from qibo import Circuit
c = Circuit(5) # Default wire names are [0, 1, 2, 3, 4]
c = Circuit(["A", "B", "C", "D", "E"])
Expand All @@ -130,12 +139,7 @@ class Circuit:
Args:
nqubits (int | list, optional): Number of qubits in the circuit or a list of wire names.
wire_names (list, optional): List of wire names.
- Either ``nqubits`` or ``wire_names`` must be provided.
- If only ``nqubits`` is provided, wire names will default to [``0``, ``1``, ..., ``nqubits - 1``].
- If only ``wire_names`` is provided, ``nqubits`` will be set to the length of ``wire_names``.
- ``nqubits`` and ``wire_names`` must be consistent with each other.
wire_names (list, optional): List of wire names
init_kwargs (dict): a dictionary with the following keys
- *nqubits*
Expand Down

0 comments on commit e485312

Please sign in to comment.