Skip to content

Tensor-Network Circuit Simulation

A quantum circuit becomes a tensor network by replacing each gate with its matrix elements and each wire segment with a contracted index. The requested output determines the network: one amplitude, an expectation value, a probability marginal, and a sample are different computational tasks. Gate count alone does not predict the contraction cost.

Required background. Tensor-network contraction costs and statevector simulation provide the representation and small-circuit reference.

Amplitudes and doubled probability networks

Section titled “Amplitudes and doubled probability networks”

For a computational-basis input ∣x⟩|x\rangle and output ∣y⟩|y\rangle, the amplitude ⟨y∣U∣x⟩\langle y|U|x\rangle is a single-layer scalar network. Its squared modulus is the probability of that particular output. Summing many amplitudes before taking the modulus instead describes a coherent projection, not a marginal probability.

To obtain the marginal probability of specified output bits, contract ket and bra networks, identify and sum their unspecified physical output indices, and project the specified ones. To obtain ⟨O⟩\langle O\rangle, insert OO between output legs. Gates outside an observable’s backward causal region may cancel with their adjoints, substantially reducing the network.

A contraction order chooses which pair of tensors is merged next. Its largest intermediate tensor controls memory. For binary indices, ww open intermediate legs require 2w2^w complex entries. A circuit with many gates can still be easy if it has narrow separators; a modest gate count can be hard if intermediate width grows.

Index slicing fixes one or more troublesome indices, contracts every slice, and sums the results. It lowers peak memory while increasing repeated arithmetic. Sum slices with a stable reduction and deterministic bookkeeping. Slicing is exact up to arithmetic if every slice is included; omitting small-looking slices without an error estimate changes the algorithm.

One may instead evolve an MPS gate by gate. Adjacent gates use a two-site update; nonadjacent gates require swaps, a different ordering, or a nonlocal contraction. Count the extra entanglement and truncations introduced by routing.

Start from ∣00⟩|00\rangle, apply HH to the first qubit, then CNOT with that qubit as control. The only nonzero amplitudes are

⟨00∣U∣00⟩=⟨11∣U∣00⟩=12.\langle00|U|00\rangle =\langle11|U|00\rangle=\frac1{\sqrt2}.

Therefore P(00)=P(11)=1/2P(00)=P(11)=1/2 and P(q1=0)=1/2P(q_1=0)=1/2. A marginal computed by summing amplitudes would give the wrong result in more general interference cases. Check normalization of the full distribution, the perfect Z1Z2Z_1Z_2 correlation, and the vanishing single-qubit ZZ expectations.

An MPS needs bond dimension two to represent this pair. Compressing to one gives a large, exactly known representation error even though individual sampled strings can still look plausible.

Sequential sampling first computes P(y1)P(y_1), draws y1y_1, then contracts for P(y2∣y1)P(y_2\mid y_1), and continues. Cached environments can reuse prior work. The product of these conditional probabilities is the joint distribution. One cheap amplitude does not imply cheap exact sampling of all outcomes.

Noisy channels can be represented by doubled operator tensors or sampled trajectories. The former increases local dimensions; the latter adds statistical uncertainty. Report which representation was used and whether its probabilities were clipped or renormalized. Significant negative probabilities indicate an error, not a normal feature of quantum interference.

Compare independent contraction orders on short circuits. Exact orders should agree within roundoff; truncated orders need bond-dimension convergence and retained/discarded norm records. Compare observable estimates as well as state fidelity. Include precision, peak intermediate size, number of slices, and preprocessing time when comparing runtimes.

A network slice sum contains complex terms asa_s. Why is ∑s∣as∣2\sum_s|a_s|^2 generally not the probability of the full amplitude?

Solution

The amplitude is A=∑sasA=\sum_sa_s, so its probability is ∣A∣2|A|^2, including interference terms asas′∗a_sa_{s'}^* for s≠s′s\ne s'. Slicing is an internal algebraic decomposition, not a physical measurement that destroys those coherences.

  • Markov, Igor L., and Yaoyun Shi, “Simulating quantum computation by contracting tensor networks,” SIAM Journal on Computing 38, 963–981 (2008), arXiv:quant-ph/0511069 — contraction complexity and graph structure.
  • Schollwöck, Ulrich, “The density-matrix renormalization group in the age of matrix product states,” Annals of Physics 326, 96–192 (2011), arXiv:1008.3477 — canonical gauges, contractions, and finite-chain algorithms.