I want to know what exactly state preparation means in a quantum computing. Are preparing a quantum state by applying different operations on it or we are preparing by some other methods?

  • 2
    $\begingroup$ Welcome to QCSE. Your question seems very broad. Maybe you can edit it to be more focussed. Often when we talk about state preparation in quantum computing we want to find a circuit (a sequence of quantum operations/gates) that prepares a quantum state $|\psi \rangle$ of interest. $\endgroup$
    – Callum
    Sep 24 at 16:01

1 Answer 1


Quantum state preparation is similar to initialization of variables in classical computing. At the beginning all qubits are in state $|0\rangle$ (similarly classical numerical variables contain zeros, text variables zero length string or null values etc.). To prepare state means that qubits are somehow changed to be in desired state, described generally as superposition $$ \sum_{i=0}^{2^n-1} a_i |i\rangle, $$ where $n$ is number of qubits, $a_i$ are complex numbers (so-called probability amplitudes), $|i\rangle$ are basis states (for simplicity, consider basis states to be strings of 0 and 1, but there can be another bases). It must hold that $$ \sum_{i=0}^{2^n-1} |a_i|^2 = 1. $$ The reason for this condition is that $|a_i|^2$ is probability of measuring qubits to be in state $|i\rangle$.

Example of two-qubit quantum state is $$ 0.5(|00\rangle + |01\rangle + |10\rangle + |11\rangle). $$ In this case you would measure any of strings 00, 01, 10 or 11 with probability 25%.

The quantum state is prepared with so-called quantum gates. They are analog to logical gates on a classical computer. They manipulate qubits to set them to desired state. Combining proper gates in proper order you get desired states. Note that the gates are described by unitary matrices. For list of quantum gates, have a look here.

The example above is prepared with so-called Hadamard gate which can set qubits to uniformly distributed superposition.

  • $\begingroup$ @MarkSpinelli: thanks a lot $\endgroup$ Sep 25 at 12:49
  • $\begingroup$ What a thorough post. $\endgroup$ Sep 25 at 12:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.