Operations glossary¶
Overview¶
This page is a reference that defines the various classical and quantum operations you can use to manipulate qubits in a quantum circuit. Quantum operations include quantum gates, such as the Hadamard gate, as well as operations that are not quantum gates, such as the measurement operation.
The operations are colorcoded as follows:
Red: Hadamard gate
Dark blue: Classical gates
Light blue: Phase gates
Grey: Nonunitary operations
Pink or dark red: Other quantum gates
Each entry below provides details and the OpenQASM reference for each operation. The qsphere image in each gate entry below shows the state after the gate operates on the initial equal superposition state , where is the number of qubits needed to support the gate.
You can define a custom operation to use in Circuit Composer. For instructions, see Create a custom operation in OpenQASM.
To learn more about using operations to create quantum algorithms, see the single and multiqubit gates chapter of the Qiskit textbook, Learn Quantum Computation using Qiskit.
Note
The gate colors are slightly different in the light and dark themes. The colors from the light theme are shown here.
Click on a quantum operation below to view its definition. Operations no longer used in Circuit Composer are listed in the Obsolete operations section as a historical reference.
X gate¶
The Pauli X gate, also known as the NOT gate, flips the state to , and vice versa. The X gate is equivalent to RX for the angle or to ‘HZH’.
For more information about the X gate, see XGate in the Qiskit Circuit Library.
Composer reference 
OpenQASM reference 
Note about qsphere representations 



The qsphere representation shows the state after the gate operates on the initial equal superposition state where is the number of qubits needed to support the gate. 
CX gate¶
The controlledX gate, also known as the controlledNOT gate, acts on a pair of qubits, with one acting as ‘control’ and the other as ‘target’. It performs an X on the target whenever the control is in state . If the control qubit is in a superposition, this gate creates entanglement.
All unitary circuits can be decomposed into single qubit gates and CX gates. Because the twoqubit CX gate costs much more time to execute on real hardware than single qubit gates, circuit cost is sometimes measured in the number of CX gates.
For more information about the CX gate, see CXGate in the Qiskit Circuit Library.
Composer reference 
OpenQASM reference 
Note about qsphere representations 



The qsphere representation shows the state after the gate operates on the initial equal superposition state where is the number of qubits needed to support the gate. 
CCX gate¶
The double controlledX gate, commonly known as the Toffoli, has two control qubits and one target. At applies an X to the target only when both controls are in state .
The CCX gate with the Hadamard gate is a universal gate set for quantum computing.
For more information about the CCX gate, see CCXGate in the Qiskit Circuit Library.
Composer reference 
OpenQASM reference 
Note about qsphere representations 



The qsphere representation shows the state after the gate operates on the initial equal superposition state where is the number of qubits needed to support the gate. 
SWAP gate¶
The SWAP gate swaps the states of two qubits.
For more information about the SWAP gate, see SwapGate in the Qiskit Circuit Library.
Composer reference 
OpenQASM reference 
Note about qsphere representations 



The qsphere representation shows the state after the gate operates on the initial equal superposition state where is the number of qubits needed to support the gate. 
CSWAP gate¶
The CSWAP gate, also called the Fredkin gate, swaps the states of the two target qubits if the control qubit is in the state.
For more information about the CSWAP gate, see CSwapGate in the Qiskit Circuit Library.
Composer reference 
OpenQASM reference 
Note about qsphere representations 



The qsphere representation shows the state after the gate operates on the initial equal superposition state where is the number of qubits needed to support the gate. 
T gate¶
The T gate is equivalent to RZ for the angle . Faulttolerant quantum computers will compile all quantum programs down to just the T gate and its inverse, as well as the Clifford gates.
For more information about the T gate, see TGate in the Qiskit Circuit Library.
Composer reference 
OpenQASM reference 
Note about qsphere representations 



The qsphere representation shows the state after the gate operates on the initial equal superposition state where is the number of qubits needed to support the gate. 
S gate¶
The S gate is applies a phase of to the state. It is equivalent to RZ for the angle . This gate is sometimes referred to as “phase gate”.
For more information about the S gate, see SGate in the Qiskit Circuit Library.
Composer reference 
OpenQASM reference 
Note about qsphere representations 



The qsphere representation shows the state after the gate operates on the initial equal superposition state where is the number of qubits needed to support the gate. 
Z gate¶
The Pauli Z gate acts as identity on the state and multiplies the sign of the state by 1. It therefore flips the and states. In the +/ basis, it plays the same role as the X gate in the / basis.
For more information about the Z gate, see ZGate in the Qiskit Circuit Library.
Composer reference 
OpenQASM reference 
Note about qsphere representations 



The qsphere representation shows the state after the gate operates on the initial equal superposition state where is the number of qubits needed to support the gate. 
Sdg gate¶
The inverse of the S gate.
For more information about the Sdg gate, see SdgGate in the Qiskit Circuit Library.
Composer reference 
OpenQASM reference 
Note about qsphere representations 



The qsphere representation shows the state after the gate operates on the initial equal superposition state where is the number of qubits needed to support the gate. 
Tdg gate¶
The inverse of the T gate.
For more information about the Tdg gate, see TdgGate in the Qiskit Circuit Library.
Composer reference 
OpenQASM reference 
Note about qsphere representations 



The qsphere representation shows the state after the gate operates on the initial equal superposition state where is the number of qubits needed to support the gate. 
U1 gate¶
The U1 gate applies a phase of to the state. For certain values of , it is equivalent to other gates. For example, U1()=Z U1()=S, and U1()=T. Up to a global phase of , it is equivalent to RZ().
For more information about the U1 gate, see U1Gate in the Qiskit Circuit Library.
Composer reference 
OpenQASM reference 
Note about qsphere representations 



The qsphere representation shows the state after the gate operates on the initial equal superposition state where is the number of qubits needed to support the gate. 
In Circuit Composer, the default value for theta
is .
Barrier operation¶
To make your quantum program more efficient, the compiler will try to combine gates. The barrier is an instruction to the compiler to prevent these combinations being made. Additionally, it is useful for visualizations.
For more information about the Barrier instruction, see Barrier in the Qiskit Circuit Library.
Composer reference 
OpenQASM reference 


Reset operation¶
The reset operation returns a qubit to state , irrespective of its state before the operation was applied. It is not a reversible operation.
Composer reference 
OpenQASM reference 


IF operation¶
The IF operation allows quantum gates to be conditionally applied, depending on the state of a classical register.
Composer reference 
OpenQASM reference 


Measurement¶
Measurement in the standard basis, also known as the z basis or computational basis. Can be used to implement any kind of measurement when combined with gates. It is not a reversible operation.
Composer reference 
OpenQASM reference 


H gate¶
The H, or Hadamard, gate rotates the states and to and , respectively. It is useful for making superpositions. If you have a universal gate set on a classical computer and add the Hadamard gate, it becomes a universal gate set on a quantum computer.
For more information about the H gate, see HGate in the Qiskit Circuit Library.
Composer reference 
OpenQASM reference 
Note about qsphere representations 



The qsphere representation shows the state after the gate operates on the initial equal superposition state where is the number of qubits needed to support the gate. 
RX gate¶
The RX gate implements . On the Bloch sphere, this gate corresponds to rotating the qubit state around the x axis by the given angle.
For more information about the RX gate, see RXGate in the Qiskit Circuit Library.
Composer reference 
OpenQASM reference 
Note about qsphere representations 



The qsphere representation shows the state after the gate operates on the initial equal superposition state where is the number of qubits needed to support the gate. 
In Circuit Composer, the default value for angle
is . Therefore, this is the angle used in the qsphere visualization below.
RY gate¶
The RY gate implements . On the Bloch sphere, this gate corresponds to rotating the qubit state around the y axis by the given angle and does not introduce complex amplitudes.
For more information about the RY gate, see RYGate in the Qiskit Circuit Library.
Composer reference 
OpenQASM reference 
Note about qsphere representations 



The qsphere representation shows the state after the gate operates on the initial equal superposition state where is the number of qubits needed to support the gate. 
In Circuit Composer, the default value for angle
is . Therefore, this is the angle used in the qsphere visualization below.
RZ gate¶
The RZ gate implements . On the Bloch sphere, this gate corresponds to rotating the qubit state around the z axis by the given angle. It is a diagonal gate and is equivalent to U1 up to a phase of .
For more information about the RZ gate, see RZGate in the Qiskit Circuit Library.
Composer reference 
OpenQASM reference 
Note about qsphere representations 



The qsphere representation shows the state after the gate operates on the initial equal superposition state where is the number of qubits needed to support the gate. 
In Circuit Composer, the default value for angle
is . Therefore, this is the angle used in the qsphere visualization below.
U3 gate¶
The three parameters allow the construction of any singlequbit gate. Has a duration of one unit of gate time.
For more information about the U3 gate, see U3Gate in the Qiskit Circuit Library.
Composer reference 
OpenQASM reference 
Note about qsphere representations 



The qsphere representation shows the state after the gate operates on the initial equal superposition state where is the number of qubits needed to support the gate. 
In Circuit Composer, the default value for the angles is .
Y gate¶
The Pauli Y gate is equivalent to Ry for the angle . It is equivalent to applying X and Z, up to a global phase factor.
For more information about the Y gate, see YGate in the Qiskit Circuit Library.
Composer reference 
OpenQASM reference 
Note about qsphere representations 



The qsphere representation shows the state after the gate operates on the initial equal superposition state where is the number of qubits needed to support the gate. 
U2 gate¶
The two parameters control two different rotations within the gate. Has a duration of one unit of gate time.
For more information about the U2 gate, see U2Gate in the Qiskit Circuit Library.
Composer reference 
OpenQASM reference 
Note about qsphere representations 



The qsphere representation shows the state after the gate operates on the initial equal superposition state where is the number of qubits needed to support the gate. 
In Circuit Composer, the default value for the angles is .
CH gate¶
The controlledHadamard gate acts on a control and target qubit. It performs an H on the target whenever the control is in state .
For more information about the CH gate, see CHGate in the Qiskit Circuit Library.
Composer reference 
OpenQASM reference 
Note about qsphere representations 



The qsphere representation shows the state after the gate operates on the initial equal superposition state where is the number of qubits needed to support the gate. 
CY gate¶
The controlledY gate acts on a control and target qubit. It performs a Y on the target whenever the control is in state .
For more information about the CY gate, see CYGate in the Qiskit Circuit Library.
Composer reference 
OpenQASM reference 
Note about qsphere representations 



The qsphere representation shows the state after the gate operates on the initial equal superposition state where is the number of qubits needed to support the gate. 
CZ gate¶
The controlledZ gate acts on a control and target qubit. It performs a Z on the target whenever the control is in state . This gate is symmetric; swapping the two qubits it acts on doesn’t change anything.
For more information about the CZ gate, see CZGate in the Qiskit Circuit Library.
Composer reference 
OpenQASM reference 
Note about qsphere representations 



The qsphere representation shows the state after the gate operates on the initial equal superposition state where is the number of qubits needed to support the gate. 
CRX gate¶
Applies the RX gate to the target qubit if the control qubit is in state
, or alternatively in state
if the argument ctrl_state
is set to 0.
For more information about the CRX gate, see CRXGate in the Qiskit Circuit Library.
Composer reference 
OpenQASM reference 
Note about qsphere representations 



The qsphere representation shows the state after the gate operates on the initial equal superposition state where is the number of qubits needed to support the gate. 
In Circuit Composer, the default value for angle
is .
CRY gate¶
Applies the RY gate to the target qubit if the control qubit is in state
, or alternatively in state
if the argument ctrl_state
is set to 0.
The CRY gate can be used to map functions to qubit amplitudes, for example as in the LinearPauliRotations circuit, which implements a linear function.
For more information about the CRY gate, see CRYGate in the Qiskit Circuit Library.
Composer reference 
OpenQASM reference 
Note about qsphere representations 



The qsphere representation shows the state after the gate operates on the initial equal superposition state where is the number of qubits needed to support the gate. 
In Circuit Composer, the default value for angle
is .
CRZ gate¶
The controlledRZ gate acts on a control and target qubit. It performs an RZ rotation on the target whenever the control is in state .
For more information about the CRZ gate, see CRZGate in the Qiskit Circuit Library.
Composer reference 
OpenQASM reference 
Note about qsphere representations 



The qsphere representation shows the state after the gate operates on the initial equal superposition state where is the number of qubits needed to support the gate. 
In Circuit Composer, the default value for angle
is .
CU1 gate¶
Applies the U1 gate if the control qubit is in state
, or alternatively in state
if the argument ctrl_state
is set to 0. This is
a diagonal and symmetric gate. One usage of this gate is in the quantum Fourier transform.
For more information about the CU1 gate, see CU1Gate in the Qiskit Circuit Library.
Composer reference 
OpenQASM reference 
Note about qsphere representations 



The qsphere representation shows the state after the gate operates on the initial equal superposition state where is the number of qubits needed to support the gate. 
In Circuit Composer, the default value for angle
is .
CU3 gate¶
Applies the U3 gate if the control qubit is in state
, or alternatively in state
if the argument ctrl_state
is set to 0.
For more information about the CU3 gate, see CU3Gate in the Qiskit Circuit Library.
Composer reference 
OpenQASM reference 
Note about qsphere representations 



The qsphere representation shows the state after the gate operates on the initial equal superposition state where is the number of qubits needed to support the gate. 
In Circuit Composer, the default value for angle
is .
RXX gate¶
The RXX gate implements . The Mølmer–Sørensen gate, the native gate on iontrap systems, can be expressed as a sum of RXX gates.
For more information about the RXX gate, see RXXGate in the Qiskit Circuit Library.
Composer reference 
OpenQASM reference 
Note about qsphere representations 



The qsphere representation shows the state after the gate operates on the initial equal superposition state where is the number of qubits needed to support the gate. 
In Circuit Composer, the default value for angle
is .
RZZ gate¶
The RZZ gate requires a single parameter: an angle expressed in radians. This gate is symmetric; swapping the two qubits it acts on doesn’t change anything.
For more information about the RZZ gate, see RZZGate in the Qiskit Circuit Library.
Composer reference 
OpenQASM reference 
Note about qsphere representations 



The qsphere representation shows the state after the gate operates on the initial equal superposition state where is the number of qubits needed to support the gate. 
In Circuit Composer, the default value for angle
is .