@@ -29,59 +29,49 @@ def __init__(self, data=None, check_symplectic: bool = True):
2929 Clifford operations and Pauli-measurements.
3030
3131 If check_symplectic=True then a check will be made that all stabilizers commute, by checking
32- That the matrix is symplectic. Otherwise no check is made.
33-
34- :param data:
35- Can be one of the following:
36-
37- A binary array of rank 2:
38- A binary array representing the generators of the stabilizer group.
39- If the array is n-by-2n a stabilizer state on n qubits will be represented.
40- The n first columns are the X-stabilizers and the n last the Z-stabilizer.
41- If the array is n-by-(2n+1), the last column is seen as the phase for each generator
42- as follows:
43- 0 -> 1
44- 1 -> -1
45-
46- An array of rank 1 containing 'str':
47- Then each string is assumed to be a generator as for example "XXZIY"
48- Note that each string in the array should have the same length.
49- If the number of strings is 'n' then a stabilizer state on 'n' qubits is created.
50- If the strings have length 'n' then it is assumed that the phase is '+1'.
51- An explicit phase can be added to the start of the string as for example: "-1XXXY".
52- Creating a Bell-pair:
53- StabilizerState(["XX", "ZZ"]) # The state (|00> + |11>) / sqrt(2)
54-
55- 'None' (default):
56- Then this is seen as a stabilizer state on no qubits, i.e. a complex number.
57- To add a qubit to such a state one can do:
58- s = StabilizerState()
59- s.add_qubit() # This is now in the state |0>
60-
61- 'int':
62- Then a stabilizer state on this many qubits are created, all in the state |0> as:
63- StabilizerState(5) # This is the then the state |00000>
64-
65- 'networkx.Graph':
66- Then the graph state corresponding to this graph will be created.
67- This assumes that the nodes are numbered from 0 to n - 1, where n is the number of nodes.
68- For example:
69- StabilizerState(networkx.complete_graph(5)) # Single qubit Clifford equiv. to a GHZ state
32+ That the matrix is symplectic. Otherwise, no check is made.
7033
7134 Examples:
72- A qubit in the state |0> can be created as:
73- StabilizerState([[0, 1]])
74-
75- A qubit in the state |1> can be created as:
76- StabilizerState([[0, 1, 1]])
77-
78- The entangled state (|00> + |11>)/sqrt(2) can be created as:
79- StabilizerState([[1, 1, 0, 0],
80- 0, 0, 1, 1]])
81-
82- The entangled state (|01> + |10>)/sqrt(2) can be created as:
83- StabilizerState([[1, 1, 0, 0, 0],
84- 0, 0, 1, 1, 1]])
35+ A qubit in the state :math:`|0>` can be created as ``StabilizerState([[0, 1]])``.
36+
37+ A qubit in the state :math:`|1>` can be created as ``StabilizerState([[0, 1, 1]])``.
38+
39+ The entangled state :math:`(|00> + |11>)/\sqrt(2)` can be created as
40+ ``StabilizerState([[1, 1, 0, 0], [0, 0, 1, 1]])``.
41+
42+ The entangled state :math:`(|01> + |10>)/\sqrt(2)` can be created as
43+ ``StabilizerState([[1, 1, 0, 0, 0], [0, 0, 1, 1, 1]])``.
44+
45+ :param data: Can be one of the following:
46+
47+ * A binary array of rank 2 representing the generators of the stabilizer group.
48+ If the array is n-by-2n a stabilizer state on n qubits will be represented.
49+ The n first columns are the X-stabilizers and the n last the Z-stabilizer.
50+ If the array is n-by-(2n+1), the last column is seen as the phase for each generator
51+ as follows:
52+ 0 -> 1
53+ 1 -> -1
54+ * An array of rank 1 containing ``str``:
55+ Then each string is assumed to be a generator as for example ``XXZIY``
56+ Note that each string in the array should have the same length.
57+ If the number of strings is ``n`` then a stabilizer state on ``n`` qubits is created.
58+ If the strings have length ``n`` then it is assumed that the phase is ``+1``.
59+ An explicit phase can be added to the start of the string as for example: ``-1XXXY``.
60+ Creating a Bell-pair:
61+ ``StabilizerState(["XX", "ZZ"]) # The state (|00> + |11>) / sqrt(2)``
62+ * ``None`` (default):
63+ Then this is seen as a stabilizer state on no qubits, i.e. a complex number.
64+ To add a qubit to such a state one can do:
65+ ``s = StabilizerState()``
66+ ``s.add_qubit() # This is now in the state |0>``
67+ * ``int``:
68+ Then a stabilizer state on this many qubits are created, all in the state :math:`|0>` as:
69+ ``StabilizerState(5) # This is the then the state |00000>``
70+ * ``networkx.Graph``:
71+ Then the graph state corresponding to this graph will be created.
72+ This assumes that the nodes are numbered from 0 to n - 1, where n is the number of nodes.
73+ For example:
74+ ``StabilizerState(networkx.complete_graph(5)) # Single qubit Clifford equiv. to a GHZ state``
8575 :param check_symplectic: Whether to check if all stabilizers commute or not.
8676 :type check_symplectic: bool
8777 """
0 commit comments