Standard implementation of the generalized GHZ circuit has a depth that grows linearly with the number of qubits.
I am looking for an optimized version in the case of 6 qubits.
Is there any?
Quantum Computing Stack Exchange is a question and answer site for engineers, scientists, programmers, and computing professionals interested in quantum computing. It only takes a minute to sign up.Sign up to join this community
If you have nearest neighbor ("grid") connectivity, you can prepare an $n$-qubit GHZ with depth $O(\log(n))$ (with the best savings when $n$ is a power of $2$):
For your case you throw away two of the CNOT's in the final layer and so this doesn't give any depth savings. However it is shallower than either linear method for all $n>6$.
If you can do adaptive measurements inside your circuit (i.e. measure a qubit and apply a correction to other qubits depending on the outcome of the measurement like in Measurement Based Quantum Computing), then you can easily create large GHZ on an arbitrary number $n$ of qubits with constant depth (5 if you start from $|0\rangle$). For instance, the circuit is examplified on a GHZ of size 6 as follows (you can trivially extend this pattern for more states):
The proof of correctness is easy to obtain using ZX-calculus (I let you do the math if you prefer the usual matrix formalism): for those that are not familiar with the ZX-calculus (I highly recommend the great introduction ZX-calculus for the working quantum computer scientist):
In ZX, we describe a quantum circuit/state using a graph made of red and green "spiders" that are decorated with an angle (if no angle is present, the angle is implicitly 0). We give a "semantic" (i.e. a corresponding matrix) to every graph made of these connected spiders using the definition:
But the exact definition is not really important here: we just need to know that we describe (up to a non-important scalar) a CNOT as:
(if you are disturbed by this vertical line that is neither an input nor an output, you can also shift the nodes to the right or left, but one can show that only "connectivity matters" in these graphs)
Therefore, the above circuit (I stopped after 4 qubits, the generalization to an arbitrary number of qubits is quite easy) is translated in ZX-calculus as:
Then, in ZX-calculus, you can rewrite the graph without changing the state associated to the graph. In particular, you can merge all spiders with the same colors by summing their angles modulo $2\pi$ (this is known as the "spider fusion rule") and move the spiders as long as you don't change their connectivity (note that any rule is still valid if you exchange the colors). Therefore, the above graph is equivalent to this one:
Now, you have another rule that tells you that a node (say a red node) with a label $a\pi$ can move through a node of the other color (say a green node) with an angle 0: in that case the original (here red node) is copied on all the other wires of the spider. For instance:
Therefore, the above graph can be rewritten as:
Then, we can do again the same operation to push the spider containing $(a \oplus b)\pi$:
Finally, we repeat this one more time for the last qubit, which gives us this equivalent graph:
Now, using the spider fusion one more time, we get this equivalent graph:
And if you check the definition of the green spider, this is exactly a GHZ state (we omitted the normalization scalars for simplicity)! Therefore:
which concludes our proof!
Here, the quantum circuit has constant depth, but it is interesting to note that in order to compute the corrections (like $a \oplus b \oplus c \oplus d \oplus e$), we need a /classical/ circuit. However, the depth of this circuit can be made logarithmic (by basically computing recursively in a tree-like shape $x = a \oplus b$, $y = c \oplus d$, then $x \oplus y$…), at least if we consider that we can copy one value on $n$ wires in a single gate (this is required as the value $a$ is used to compute all the subsequent values).