Create your first quantum circuit¶
You can use Circuit Composer to build and run a complete quantum circuit. For your “Hello world” circuit, you will create a Bell state.
The visualizations at the bottom of the page will automatically update to reflect simulated results as you add operations to your circuit. However, if you would like the option to run your circuit on real quantum hardware or a simulator, or if you wish to visualize more than four qubits, you will need to sign in to IBM Quantum by clicking the Sign in button in the upper right corner.
To follow these steps while building the circuit in IBM Quantum Composer, use the Application switcher in the top left corner to select Quantum Composer, then click the Composer docs and tutorials icon. Under Getting Started, select Create your first circuit walkthrough.
Step 1. Open IBM Quantum Composer.¶
To open Circuit Composer, click the Application switcher ( ) in the upper left corner, and choose Quantum Composer.
You will see a set of horizontal lines, or wires, that resemble a ruled piece of paper. The top wires are the qubits, and the bottom wire is a classical register.
The Files panel is automatically opened. You can close it by clicking the Files icon .
Step 2. Add an gate (Hadamard gate) to your circuit.¶
To add an gate to your circuit, drag and drop the operation from the palette of quantum operations to the top qubit, q0.
Step 3. Add a CNOT gate to your circuit.¶
To add a CNOT gate to your circuit, drag and drop the CNOT operation from the palette of quantum operations to the right of the gate. This operation acts on two qubits.
Step 4. Add measurement operations.¶
To add a measurement to your circuit, drag and drop the measurement operation from the palette of quantum operations to the right of the CNOT operation, on wire q0. Then, add another measurement on wire q1.
The measurement results are recorded as classical bits on the classical register. The vertical wire connecting the measurement operation to the bottom wire depicts information flowing from the qubit down to the classical register.
You have now built your first quantum circuit. The visualization panels below your circuit give a simulated result that updates automatically as you add and remove operations.
To learn more about visualizations, review the Visualizations topic.
For instructions to run this circuit on a quantum system, see Run circuits and view results.