Beginner’s Guide to Quantum Circuits

A practical, one‑page introduction to qubits, gates, measurement, and building your first entangled circuit in Qly.

What is a qubit?

A qubit is the quantum version of a bit. Instead of being strictly 0 or 1, a qubit can be in a superposition of both until it is measured. Measurement collapses the state to a classical 0 or 1 with probabilities determined by the state amplitudes.

Measurement

When you measure a qubit, you sample from its state. Repeating a circuit many times (shots) gives a distribution of outcomes. In Qly, you can configure shots and see histograms to understand behavior.

Key single‑qubit gates

  • H (Hadamard): creates superposition (|0⟩ → (|0⟩+|1⟩)/√2).
  • X (Pauli‑X): bit‑flip (|0⟩ ↔ |1⟩).
  • Z (Pauli‑Z): phase‑flip (adds a minus sign to |1⟩).

Two‑qubit gate

CNOT: flips the target qubit if the control is 1. With superposition on the control, CNOT can generate entanglement.

Build your first entangled pair (Bell state)

  1. Apply H to qubit 0 to make a superposition.
  2. Apply CNOT with control on qubit 0 and target on qubit 1.
  3. Measure both qubits. You should see outcomes 00 and 11 with ~50% each.

Try this now in the Qly Playground or follow the detailed steps in our tutorial: Create a Bell State.

Bloch sphere intuition

Visualize a qubit as a point on a sphere. X, Y, and Z are π‑rotations around the respective axes. H maps between computational and diagonal bases, enabling interference.

Running on real hardware

With Qly you can simulate locally and run circuits on AWS Braket directly from your account. This lets you compare ideal simulations against real device behavior.

Keep learning