Skip to content

Quantum Ansatz Circuits

tomparks edited this page Dec 19, 2018 · 7 revisions

The Ansatz circuit in VQE

Introduction

In VQE, each time you run a circuit on the quantum computer you are discovering the energy for a particular quantum state. This state is created by the ansatz circuit.

When a quantum computer first starts up, it is in the all zeros state. This is written as either |00...00> or simply |0>, and means if you measure any qubit you will get the result 0. This is like when you start your laptop, all RAM cells are off.

The job of the ansatz circuit is to transform this state to the state that represents the ground state of the molecule. In order to do this, most ansatz circuits are parametric, and you will run the circuit many times with different parameters looking for the lowest energy. Details on this part of VQE are available here.

Example ansatz circuits

The simplest ansatz circuit for Hydrogen is known as tiny1. Within CK you can look at any of the provided ansatz circuits by following the instructions on the home page under 'Visualize the ansatz circuit'.

For atomic Hydrogen is has been shown that for any bond length the ground state energy is purely a superposition of the $\ket{00}  + \ket{11}$1 basis set elements. The tiny1 ansatz controls the relative amount of each basis set element with its single parameter. Using Quirk, we can visualize the final state as a function of the parameter here.

If you are more interested in investigating classical optimisation methods, you can simply try several ansatz circuits provided by the CK framework. Or read on if you dare to learn about the hardware efficient ansatz!

Research proposal: investigate the hardware efficient ansatz

The hardware efficient ansatz is composed of rotations and entangling gates. It is so called because both the rotations and the entangling gates can efficiently run on Noisy Intermediate Scale Quantum (NISQ) computers.

The hardware efficient ansatz, used by Kandala et al for VQE in a recent paper and introduced by Farhi, is a minimal general ansatz. It alternates rotations and entangling gates as shown here for a 2-qubit problem:

A depth 2, 2 qubit hw efficient ansatz circuit with all parameters described as theta of i, acting on the zero state.

This circuit takes |0> to |P(thetas)> where thetas is the list of parameters on the gates in square boxes (rotation gates). |P(thetas)> will be our best guess for the lowest energy state of the molecule. The circled plus with a dot above is a Controlled-NOT gate (CNOT).

The circuit consists of a repeating section of 2-3 rotations on each qubit followed by an entangling gate, the CNOT. Given sufficient levels of depth this circuit can construct arbitrary states, but the number of parameters it takes grows quickly. Read on to learn more about the rotation and entangling gates!

TODO: Link to the IBM experiments. Explain "drift Hamiltonian"? For the IBM experiments on real hardware the "drift Hamiltonian", the ambient interactions of qubits when no gate was actively applied, was used as an entangler. This is easy to achieve as you just turn on the qubit interactions and wait.

Rotation gates

The first part of the HW ansatz is a sequence of rotation gates on each qubit. The state of a single qubit, not entangled with any other, corresponds to a point on the Bloch sphere:

Bloch sphere for a qubit: drawn by Glosser.ca under CC BY-SA 3.0

TODO: Clarify. Single qubit rotations are either easy or truly vital for constructing states, and so can be ignored.

For a physical system like a electron in a magnetic field, the directions on the Bloch sphere are physically meaningful: they correspond to the direction of the spin. For qubits in general we do not know the physical architecture of the computer, and so we assign |0> and |1> and the Z direction to the basis we measure in. The Rx, Ry, and Rz gates acting on a qubit will rotate the qubit's state by the given angles around the Bloch sphere.

The system starts in |0>, so a rotation about Rz will have no effect. This is why the first set of Rz gates is absent from the HW ansatz shown above.

Rotation gates are required for moving in state space, but cannot generate superposition of states by themselves as each qubit is separate. For this, we need an entangling gate.

The entangling gate

A simple state that is not separable in the computational basis is the Bell state $\ket{00}  + \ket{11}$1.

In order to generate this state from $\ket{00}$ we first apply a Hadamard gate on the first qubit to get the state $\ket{00}  + \ket{01}$. Then applying a CNOT gate controlled by the first qubit on the second qubit will generate $\ket{00} + \ket{11}$ as desired. But without the 2 qubit gate there is no way to produce states that have this mutual information - the state of the second qubit has become linked to the state of the first.

In a molecular context this often appears as electron correlation. When one electron is in a particular location other electrons will tend to be repelled and so the positions of the electrons become correlated just like the bell state. The ability to create correlated states means that VQE solutions are equivalent in quality to full configuration interaction (FCI) solutions from existing quantum chemistry packages but with far lower resource requirements.

Avenues for improvements

The hardware efficient ansatz, as written, uses CNOT gates. In fact, you can replace the CNOT gate with any other many-qubit entangling gate. By using many-qubit gates optimally supported by your chosen hardware provider, the resource usage of the circuit could be reduced. TODO: Do we know which entanglers can be tried on IBM hardware? Rigetti hardware?

Other groups have suggested that rather than using the hardware entangler it might be best to provide parametrized entangling gates, or to directly prepare states from your knowledge of the chemistry problem. A recent review gives detail on the space of ansatz circuits people have tried so far.

footnotes

1: A quick note on normalisation: for any physical state, the squares of the absolute values of the factors before the kets (i.e. the $1.0$ in $1.0 \ket{0}$) must add to one. This is because the probability of seeing a state when you measure a state must be 1. The factors in the bell state $\ket{00} + \ket{11}$ add to $\sqrt{1.0*1.0 + 1.0*1.0} = \sqrt{2}$, and so to be properly correct a factor of $\frac{1}{\sqrt{2}}$ should be present. This clutters the notation and so we omit this as you can work out the normalisation factors from the state.

Clone this wiki locally