6.3. gates#
- class CNOT[source]#
Bases:
QuantumOperationCNOT gate on two qubits.
- getEquivalentSequence()[source]#
Return an object of the class
`Sequence`, which does not contain any operators, because this operation is considered to be as a non-decomposable operation.- Returns:
sequence – An object of the class
`Sequence`without operations, but with the appropriate bits and qubits.- Return type:
- getInverse()[source]#
Return the object itself because it is self-inverse.
- Returns:
CNOT – The same object because it is self-inverse.
- Return type:
geqo.core.fundamental_gates.CNOT
- getNumberClassicalBits()[source]#
- Returns:
0 – The number of classical bits, which are used by PermuteQubits, is zero.
- Return type:
int
- getNumberQubits()[source]#
Return the number of qubits that are used by this operation.
- Returns:
2 – The number of qubits, which are used by this gate.
- Return type:
int
- class Hadamard[source]#
Bases:
QuantumOperationHadamard gate on one qubit.
- getEquivalentSequence()[source]#
Return an object of the class
`Sequence`, which does not contain any operators, because this operation is considered to be as a non-decomposable operation.- Returns:
sequence – An object of the class
`Sequence`without operations, but with the appropriate bits and qubits.- Return type:
- getInverse()[source]#
Return the object itself because it is self-inverse.
- Returns:
Hadamard – The same object because it is self-inverse.
- Return type:
geqo.core.fundamental_gates.Hadamard
- getNumberClassicalBits()[source]#
- Returns:
0 – The number of classical bits, which are used by PermuteQubits, is zero.
- Return type:
int
- getNumberQubits()[source]#
Return the number of qubits that are used by this operation.
- Returns:
1 – The number of qubits, which are used by this gate.
- Return type:
int
- class InversePhase(name)[source]#
Bases:
QuantumOperationInverse phase shift gate on one qubit.
- getEquivalentSequence()[source]#
Return an object of the class
`Sequence`, which does not contain any operators, because this operation is considered to be as a non-decomposable operation.- Returns:
sequence – An object of the class
`Sequence`without operations, but with the appropriate bits and qubits.- Return type:
- getInverse()[source]#
Return an object of the class
`Phase`, which has the same name.- Returns:
Phase – Return an object of the class
`Phase`with the same name. It corresponds to the inverse of this operation.- Return type:
geqo.core.fundamental_gates.Phase
- getNumberClassicalBits()[source]#
- Returns:
0 – The number of classical bits, which are used by PermuteQubits, is zero.
- Return type:
int
- getNumberQubits()[source]#
Return the number of qubits that are used by this operation.
- Returns:
1 – The number of qubits, which are used by this gate.
- Return type:
int
- class InverseRx(name)[source]#
Bases:
QuantumOperationInverse rotation about X axis.
- getEquivalentSequence()[source]#
Return a sequence, which is equivalent to this gate. Here, no
`Sequence`object is returned because a basic gate cannot be decomposed.- Returns:
None – No
`Sequence`object is returned because this gate cannot be decomposed.- Return type:
None
- getInverse()[source]#
Return an object of the class
`Rx`with the same name for the angle.- Returns:
Rx – A new object of the class
`Rx`, which corresponds to the inverse operation.- Return type:
- getNumberClassicalBits()[source]#
- Returns:
0 – The number of classical bits, which are used by PermuteQubits, is zero.
- Return type:
int
- getNumberQubits()[source]#
Return the number of qubits that are used by this permuation operation.
- Returns:
1 – The number of qubits, which are used by this rotation gate.
- Return type:
int
- class InverseRy(name)[source]#
Bases:
QuantumOperationInverse rotation about Y axis.
- getEquivalentSequence()[source]#
Return a sequence, which is equivalent to this gate. Here, no
`Sequence`object is returned because a basic gate cannot be decomposed.- Returns:
None – No
`Sequence`object is returned because this gate cannot be decomposed.- Return type:
None
- getInverse()[source]#
Return an object of the class
`Ry`with the same name for the angle.- Returns:
Ry – A new object of the class
`Ry`, which corresponds to the inverse operation.- Return type:
- getNumberClassicalBits()[source]#
- Returns:
0 – The number of classical bits, which are used by PermuteQubits, is zero.
- Return type:
int
- getNumberQubits()[source]#
Return the number of qubits that are used by this permuation operation.
- Returns:
1 – The number of qubits, which are used by this rotation gate.
- Return type:
int
- class InverseRz(name)[source]#
Bases:
QuantumOperationInverse rotation about Z axis.
- getEquivalentSequence()[source]#
Return a sequence, which is equivalent to this gate. Here, no
`Sequence`object is returned because a basic gate cannot be decomposed.- Returns:
None – No
`Sequence`object is returned because this gate cannot be decomposed.- Return type:
None
- getInverse()[source]#
Return an object of the class
`Rz`with the same name for the angle.- Returns:
Rz – A new object of the class
`Rz`, which corresponds to the inverse operation.- Return type:
- getNumberClassicalBits()[source]#
- Returns:
0 – The number of classical bits, which are used by PermuteQubits, is zero.
- Return type:
int
- getNumberQubits()[source]#
Return the number of qubits that are used by this permuation operation.
- Returns:
1 – The number of qubits, which are used by this rotation gate.
- Return type:
int
- class InverseRzz(name)[source]#
Bases:
QuantumOperationInverse ZZ interaction between two qubits.
- getEquivalentSequence()[source]#
Return an object of the class
`Sequence`, which contains several operations that correspond to this gate.- Returns:
sequence – An object of the class
`Sequence`without operations, but with the appropriate bits and qubits.- Return type:
- getInverse()[source]#
Return an object of the class
`Rzz`with the same name for the angle.- Returns:
Rzz – A new object of the class
`Rzz`, which corresponds to the inverse operation.- Return type:
- getNumberClassicalBits()[source]#
- Returns:
0 – The number of classical bits, which are used by PermuteQubits, is zero.
- Return type:
int
- getNumberQubits()[source]#
Return the number of qubits that are used by this permuation operation.
- Returns:
2 – The number of qubits, which are used by this rotation gate.
- Return type:
int
- class InverseSGate[source]#
Bases:
QuantumOperationThis operation corresponds to the inverse of the square root of the Z gate on one qubit.
For the definition of the S gate, see
`https://en.wikipedia.org/wiki/Clifford_gates#S_gate`.- getEquivalentSequence()[source]#
Return an object of the class
`Sequence`, which does not contain any operators, because this operation is considered to be as a non-decomposable operation.- Returns:
sequence – An object of the class
`Sequence`without operations, but with the appropriate bits and qubits.- Return type:
- getInverse()[source]#
Return an object of the class
`SGate`.- Returns:
SGate – A new object of this class, which corresponds to the inverse operation.
- Return type:
- getNumberClassicalBits()[source]#
- Returns:
0 – The number of classical bits, which are used by PermuteQubits, is zero.
- Return type:
int
- getNumberQubits()[source]#
Return the number of qubits that are used by this operation.
- Returns:
1 – The number of qubits, which are used by this gate.
- Return type:
int
- class PauliX[source]#
Bases:
QuantumOperationPauli X gate on one qubit.
- getEquivalentSequence()[source]#
Return an object of the class
`Sequence`, which does not contain any operators, because this operation is considered to be as a non-decomposable operation.- Returns:
sequence – An object of the class
`Sequence`without operations, but with the appropriate bits and qubits.- Return type:
- getInverse()[source]#
Return the object itself because it is self-inverse.
- Returns:
PauliX – The same object because it is self-inverse.
- Return type:
geqo.core.fundamental_gates.PauliX
- getNumberClassicalBits()[source]#
- Returns:
0 – The number of classical bits, which are used by PermuteQubits, is zero.
- Return type:
int
- getNumberQubits()[source]#
Return the number of qubits that are used by this operation.
- Returns:
1 – The number of qubits, which are used by this gate.
- Return type:
int
- class PauliY[source]#
Bases:
QuantumOperationPauli Y gate on one qubit.
- getEquivalentSequence()[source]#
Return an object of the class
`Sequence`, which does not contain any operators, because this operation is considered to be as a non-decomposable operation.- Returns:
sequence – An object of the class
`Sequence`without operations, but with the appropriate bits and qubits.- Return type:
- getInverse()[source]#
Return the object itself because it is self-inverse.
- Returns:
PauliY – The same object because it is self-inverse.
- Return type:
geqo.core.fundamental_gates.PauliY
- getNumberClassicalBits()[source]#
- Returns:
0 – The number of classical bits, which are used by PermuteQubits, is zero.
- Return type:
int
- getNumberQubits()[source]#
Return the number of qubits that are used by this operation.
- Returns:
1 – The number of qubits, which are used by this gate.
- Return type:
int
- class PauliZ[source]#
Bases:
QuantumOperationPauli Z gate on one qubit.
- getEquivalentSequence()[source]#
Return an object of the class
`Sequence`, which does not contain any operators, because this operation is considered to be as a non-decomposable operation.- Returns:
sequence – An object of the class
`Sequence`without operations, but with the appropriate bits and qubits.- Return type:
- getInverse()[source]#
Return the object itself because it is self-inverse.
- Returns:
PauliZ – The same object because it is self-inverse.
- Return type:
geqo.core.fundamental_gates.PauliZ
- getNumberClassicalBits()[source]#
- Returns:
0 – The number of classical bits, which are used by PermuteQubits, is zero.
- Return type:
int
- getNumberQubits()[source]#
Return the number of qubits that are used by this operation.
- Returns:
1 – The number of qubits, which are used by this gate.
- Return type:
int
- class Phase(name)[source]#
Bases:
QuantumOperationPhase shift gate on one qubit.
- getEquivalentSequence()[source]#
Return an object of the class
`Sequence`, which does not contain any operators, because this operation is considered to be as a non-decomposable operation.- Returns:
sequence – An object of the class
`Sequence`without operations, but with the appropriate bits and qubits.- Return type:
- getInverse()[source]#
Return an object of the class
`InversePhase`, which has the same name.- Returns:
InversePhase – Return an object of the class
`InversePhase`with the same name. It corresponds to the inverse of this operation.- Return type:
geqo.core.fundamental_gates.InversePhase
- getNumberClassicalBits()[source]#
- Returns:
0 – The number of classical bits, which are used by PermuteQubits, is zero.
- Return type:
int
- getNumberQubits()[source]#
Return the number of qubits that are used by this operation.
- Returns:
1 – The number of qubits, which are used by this gate.
- Return type:
int
- class Rx(name)[source]#
Bases:
QuantumOperationRotation about X axis in Bloch sphere.
- getEquivalentSequence()[source]#
Return a sequence, which is equivalent to this gate. Here, no
`Sequence`object is returned because a basic gate cannot be decomposed.- Returns:
None – No
`Sequence`object is returned because this gate cannot be decomposed.- Return type:
None
- getInverse()[source]#
Return an object of the class
`InverseRx`with the same name for the angle.- Returns:
InverseRx – A new object of the class
`InverseRx`, which corresponds to the inverse operation.- Return type:
- getNumberClassicalBits()[source]#
- Returns:
0 – The number of classical bits, which are used by PermuteQubits, is zero.
- Return type:
int
- getNumberQubits()[source]#
Return the number of qubits that are used by this permuation operation.
- Returns:
1 – The number of qubits, which are used by this rotation gate.
- Return type:
int
- class Ry(name)[source]#
Bases:
QuantumOperationRotation about Y axis in Bloch sphere.
- getEquivalentSequence()[source]#
Return a sequence, which is equivalent to this gate. Here, no
`Sequence`object is returned because a basic gate cannot be decomposed.- Returns:
None – No
`Sequence`object is returned because this gate cannot be decomposed.- Return type:
None
- getInverse()[source]#
Return an object of the class
`InverseRy`with the same name for the angle.- Returns:
InverseRy – A new object of the class
`InverseRy`, which corresponds to the inverse operation.- Return type:
- getNumberClassicalBits()[source]#
- Returns:
0 – The number of classical bits, which are used by PermuteQubits, is zero.
- Return type:
int
- getNumberQubits()[source]#
Return the number of qubits that are used by this permuation operation.
- Returns:
1 – The number of qubits, which are used by this rotation gate.
- Return type:
int
- class Rz(name)[source]#
Bases:
QuantumOperationRotation about Z axis in Bloch sphere.
- getEquivalentSequence()[source]#
Return a sequence, which is equivalent to this gate. Here, no
`Sequence`object is returned because a basic gate cannot be decomposed.- Returns:
None – No
`Sequence`object is returned because this gate cannot be decomposed.- Return type:
None
- getInverse()[source]#
Return an object of the class
`InverseRz`with the same name for the angle.- Returns:
InverseRz – A new object of the class
`InverseRz`, which corresponds to the inverse operation.- Return type:
- getNumberClassicalBits()[source]#
- Returns:
0 – The number of classical bits, which are used by PermuteQubits, is zero.
- Return type:
int
- getNumberQubits()[source]#
Return the number of qubits that are used by this permuation operation.
- Returns:
1 – The number of qubits, which are used by this rotation gate.
- Return type:
int
- class Rzz(name)[source]#
Bases:
QuantumOperationZZ interaction between two qubits.
- getEquivalentSequence()[source]#
Return an object of the class
`Sequence`, which contains several operations that correspond to this gate.- Returns:
sequence – An object of the class
`Sequence`without operations, but with the appropriate bits and qubits.- Return type:
- getInverse()[source]#
Return an object of the class
`InverseRzz`with the same name for the angle.- Returns:
InverseRzz – A new object of the class
`InverseRzz`, which corresponds to the inverse operation.- Return type:
- getNumberClassicalBits()[source]#
- Returns:
0 – The number of classical bits, which are used by PermuteQubits, is zero.
- Return type:
int
- getNumberQubits()[source]#
Return the number of qubits that are used by this permuation operation.
- Returns:
2 – The number of qubits, which are used by this rotation gate.
- Return type:
int
- class SGate[source]#
Bases:
QuantumOperationThis operation corresponds to the square root of the Z gate on one qubit.
For the definition, see
`https://en.wikipedia.org/wiki/Clifford_gates#S_gate`.- getEquivalentSequence()[source]#
Return an object of the class
`Sequence`, which does not contain any operators, because this operation is considered to be as a non-decomposable operation.- Returns:
sequence – An object of the class
`Sequence`without operations, but with the appropriate bits and qubits.- Return type:
- getInverse()[source]#
Return an object of the class
`InverseSGate`.- Returns:
InverseSGate – A new object of this class, which corresponds to the inverse operation.
- Return type:
- getNumberClassicalBits()[source]#
- Returns:
0 – The number of classical bits, which are used by PermuteQubits, is zero.
- Return type:
int
- getNumberQubits()[source]#
Return the number of qubits that are used by this operation.
- Returns:
1 – The number of qubits, which are used by this gate.
- Return type:
int
- class SwapQubits[source]#
Bases:
QuantumOperationSwap gate on two qubits.
- getEquivalentSequence()[source]#
Return an object of the class
`Sequence`, which does not contain any operators, because this operation is considered to be as a non-decomposable operation.- Returns:
sequence – An object of the class
`Sequence`without operations, but with the appropriate bits and qubits.- Return type:
- getInverse()[source]#
Return the object itself because it is self-inverse.
- Returns:
SwapQubits – The same object because it is self-inverse.
- Return type:
geqo.core.fundamental_gates.SwapQubits
- getNumberClassicalBits()[source]#
- Returns:
0 – The number of classical bits, which are used by PermuteQubits, is zero.
- Return type:
int
- getNumberQubits()[source]#
Return the number of qubits that are used by this operation.
- Returns:
2 – The number of qubits, which are used by this gate.
- Return type:
int
- class Toffoli(nameSpacePrefix='')[source]#
Bases:
QuantumOperationToffoli (CCNOT) gate on three qubits.
- getEquivalentSequence()[source]#
Return an object of the class
`Sequence`, which contains several operations that correspond to the Toffoli gate. The name space prefix is prepended to all internal gates when needed.- Returns:
sequence – An object of the class
`Sequence`without operations, but with the appropriate bits and qubits. The name space prefix is prepended to all internal gates when needed.- Return type:
- getInverse()[source]#
Return the same object, because it is inverse to itself.
- Returns:
Toffoli – Return the object, because it is self-inverse.
- Return type:
- getNumberClassicalBits()[source]#
- Returns:
0 – The number of classical bits, which are used by PermuteQubits, is zero.
- Return type:
int
- getNumberQubits()[source]#
Return the number of qubits that are used by this permuation operation.
- Returns:
3 – The Toffoli gate acts on 3 qubits.
- Return type:
int