These problems check the definitions of Module 6, redo its key derivations by hand, and point at the hands-on gaps of notebook 06 in both languages.
Problem 6.1Β (Operator Schmidt rank of CZ, CNOT and SWAP).
Write a two-qubit gate as with as few terms as possible (the operator Schmidt rank).
Show that CZ has , and find the decomposition.
Show that CNOT also has .
Show that SWAP has .
Using Proposition 6.3, what is the largest Schmidt rank across the middle cut of qubits after 6 crossing CZ gates? After 6 crossing SWAP gates?
Solution
: on the second qubit is untouched, on it gets a . That is two terms. It cannot be one term, because a product maps product states to product states, while CZ maps to an entangled state. So .
Local gates on one side do not change the operator Schmidt rank: , and the stay linearly independent. So CNOT has .
The four products () are orthogonal in the Hilbert-Schmidt inner product, , so they are linearly independent and the decomposition has four nonzero operator Schmidt values, all equal. To check the formula, use the Bell basis, where , , are all diagonal. On the three symmetric states , the eigenvalues are , , , so the right-hand side gives . On the singlet they are and the right-hand side gives . SWAP has exactly these eigenvalues: on symmetric states, on the antisymmetric one.
The rank starts at 1 and is multiplied by at most per crossing gate, and it can never exceed (the dimension of half of the qubits). With CZ: . With SWAP: as well, but SWAP reaches the cap after only 3 crossing gates. (A chain of SWAPs on a product state of course creates no entanglement at all; the proposition is an upper bound.)
Problem 6.2Β (Per-gate fidelity and the normalization pitfall).
An MPS is in mixed canonical form, and after a two-qubit gate the Schmidt values across the gateβs bond are with chosen so that .
Compute , and the kept weight and discarded weight when truncating to .
Suppose the circuit has 40 such truncations with the same and the code never renormalizes. What does fidelity_estimate() (the squared norm ) return?
Assume the product rule holds for the true fidelity . What would you report if you forgot to divide by the norm, that is, if you used as the fidelity?
Solution
, so . Keeping two values, and . By Proposition 6.1 this is exactly the overlap fidelity of the truncated, renormalized state with the untruncated one.
Each unnormalized truncation multiplies the squared norm by , so .
With , . If as well, the unnormalized number is , the square of the right answer. In the worked example of the notes, gives , the same identity in real data.
Problem 6.3Β (The exact fidelity bound, and how weak it is).
Show that for unit vectors , .
Show that for , and conclude that one renormalized truncation moves the state by at most in norm.
Combine these with the triangle inequality to prove with , as in Theorem 6.1.
Evaluate the product estimate , the bound , and the form for 66 truncations with each, and for 66 truncations with each. What does this say about using the bound in practice?
Solution
. Rearranging gives the claim.
For we have , so . With the state before truncation, the projector onto the kept Schmidt vectors, and , the renormalized state satisfies .
Let . A gate is unitary, so it does not change the distance; the truncation adds at most . Hence . By part 1, , and .
For : the product is . Here , so the bound gives , and says nothing. For : the product is , , the bound is , and . The bound is rigorous but loses a factor of order in the infidelity, because it adds square roots. It is useful as a certificate when errors are tiny; for forecasting, the product rule is what one uses, and the worked example of the notes shows that it is accurate for random circuits.
Problem 6.4Β (Pauli rotations and the kicked Ising step).
Compute and as linear combinations of Pauli matrices.
One kicked Ising step is with applied first and second. Show that the part is a rotation of the form with a Clifford angle, and compute its action on for two qubits.
In the Heisenberg picture we compute . On a chain of three qubits with bonds and , how many Pauli strings can contain after one step, at most?
Solution
and anticommute, so . Since , this is . Similarly , using .
with , a multiple of , so it is Clifford. On two qubits, anticommutes with , so . One string goes to one string: no branching.
Conjugate in the order . The layer commutes with , so it does nothing. The layer only touches qubit 1 nontrivially (the , rotations commute with ), and turns into : at most 2 strings. Branching happens only at non-Clifford rotations that anticommute with the current string, which is why sparse Pauli dynamics is cheap near Clifford angles.
Problem 6.5Β (Two contraction trees for a ring).
Four tensors form a closed ring with bonds , , , , all of dimension (the network of Figure 6.5; is the index dimension of Definition 6.2, here the same on every bond).
Using the definitions of cost and width in Definition 6.2, compute the cost and the width of the tree .
Do the same for the tree .
For , how much more memory and how many more multiplications does the second tree need?
Solution
Node : the loop runs over , cost ; result . Node : also , result . Root: loops over , cost , result a scalar. So and (the largest intermediate has two legs; each input also has two).
Node : and share no index, so this is an outer product over , cost , result with four legs. Node : loops over , cost , result . Root with : cost . So and .
At the first tree has (4096 entries) and . The second has (about entries) and . That is times more memory and about 64 times more multiplications, from the same four tensors. Path finders exist to avoid outer products like .
Problem 6.6Β (Notebook gaps: the MPS circuit simulator).
Complete the gaps of notebook 06 in either language (Julia: notebooks/julia/06_circuits.ipynb; Python: notebooks/python/06_circuits.ipynb).
Hands-on 6.2 (apply_gate2! / apply_gate2): apply a two-qubit gate to neighbours and return the kept weight . Explain in one sentence why the centre must be moved to the gate first.
Hands-on 6.3 (apply_gate_long! / apply_gate_long): route a long-range gate with SWAPs and return the product of the fidelities. How many two-site updates does a gate on qubits cost?
Hands-on 6.5 (path_cost): compute and of a linear contraction order from the index labels alone. Compare the time order and the qubit order for the brickwork circuit, and explain which one wins at small depth and which at large depth.
Run the worked example and confirm that your simulatorβs product of agrees with the exact fidelity, as in the table of the notes.
Solution
The SVD of gives the Schmidt values of the whole state only when everything to the left of the pair is left-orthogonal and everything to the right is right-orthogonal. Then truncating it is the optimal cut and equals the true fidelity of that step (Proposition 6.1). Off-centre, the singular values of are distorted by the non-orthogonal environment.
For : SWAPs on carry qubit 1 to position 5, then the gate acts on , then four SWAPs undo the routing. That is two-site updates, in general, each with its own ; the function returns their product.
In time order the intermediate is the state on all wires, so at every depth and grows linearly in (times ). In qubit order the intermediate carries the legs of every gate crossing the current cut between wires. The notebookβs CZ tensors have four legs, so each crossing gate leaves two open legs (its input and output on the far wire), and with about crossing gates . For the notebook prints at against for time order, and the costs cross between and . So qubit order wins for shallow circuits and time order wins once is close to . If each CZ is first split into two three-leg tensors joined by a bond of dimension 2 (its operator Schmidt decomposition), each crossing gate leaves one leg, , and the crossover moves to . The best tree of a hyper-optimizer, which splits gates during simplification, does at least as well as both, which is the trend of Figure 6.6.
With , and the seed of the notes, the product of fidelities and the true fidelity agree to within for every (for example versus at ), and both equal 1 to six digits for .