8. Quantum Circuits with MPS

While the standard method for circuit simulation (see Quantum Circuits) uses a lazy tensor network representation of the entire quantum circuit before deciding what to compute, quimb also has support for simulating quantum circuits using matrix product states (MPS), which instead ‘eagerly’ contracts gates in and performs compression to maintain an MPS form of the full wavefunction.

%config InlineBackend.figure_formats = ['svg']

import numpy as np
import quimb.tensor as qtn

We’ll define a test circuit that is A) too large for state-vector simulation and B) too deep for exact contraction. It has arbitrarily long-range CZ entangling gates but depending on how small the angles of the single qubit U3 random rotations are, only builds up entanglement in a controlled manner.

def gen_gates(N=64, x=0.1, depth=10, seed=42):
    """Generate a long range circuit that only slowly builds up entanglement.

    Parameters
    ----------
    N : int, optional
        The number of qubits.
    x : float, optional
        The average angle magnitude of U3 rotations.
    depth : int, optional
        The number of fully entangling gate layers.
    seed : int, optional
        A random seed.

    Yields
    ------
    qtn.Gate
    """

    rng = np.random.default_rng(seed)
    qubits = list(range(N))

    for _ in range(depth):
        # random small single qubit rotations
        for q in qubits:
            yield qtn.Gate("U3", params=rng.normal(scale=x, size=3), qubits=[q])

        # random CZs between arbitrary qubit pairs
        rng.shuffle(qubits)
        for i in range(0, N, 2):
            qa = qubits[i]
            qb = qubits[i + 1]
            yield qtn.Gate("CZ", params=(), qubits=[qa, qb])

You can see that a very quick estimate of the amplitude brute-force contraction complexity gives a cost of \(\sim 10^{30}\) FLOPs, while this could be improved, its clearly not a circuit that is easy to simulate exactly.

circ_ex = qtn.Circuit.from_gates(gen_gates())
circ_ex.amplitude_rehearse(optimize="greedy")
{'tn': TensorNetworkGenVector(tensors=672, indices=448),
 'tree': <ContractionTree(N=672)>,
 'W': 77.0,
 'C': 28.60123015407627}

8.1. CircuitMPS

Instead we can use the CircuitMPS class to simulate the circuit. This class is a subclass of Circuit and has the same API for applying gates, but each time it does so it contracts the gate into the MPS representation of the wavefunction. The core gate contraction methods is uses to do so are:

The default gate_contract method is "auto-mps", which uses "swap+split" for 2-qubit gates and "nonlocal" for 3+ qubit gates.

The CircuitMPS class can be created in the same ways as a normal Circuit, but be aware that the gates are immediately contracted into the wavefunction and so the computation happens immediately. The progbar=True kwarg can thus be a useful to pass on to circ.apply_gates to see the progress of the simulation.

circ = qtn.CircuitMPS.from_gates(
    gates=gen_gates(),
    max_bond=None,
    cutoff=1e-6,
    progbar=True,
)
  0%|          | 0/960 [00:00<?, ?it/s]
max_bond=143, error~=0.00309: 100%|##########| 960/960 [00:25<00:00, 37.68it/s] 

You can see that the maximum bond dimension of the MPS has risen to 143 (out of a possible \(2^{N / 2}\) to represent an arbitrary state!), and we have incurred an approximate error of 0.003. The error is calculated as:

\[ \epsilon = 1 - \left| \langle \psi | \psi \rangle \right|^2 \approx 1 - \left| \langle \psi_\mathrm{ideal} | \psi \rangle \right|^2 = 1 - F \]

with \(F\) being the true fidelity between the ideal and approximate states.

The MPS wavefunction is can be retrieved with the CircuitMPS.psi property:

circ.psi.show()
     2 4 7 10 11 13 18 25 34 37 39 40 50 48 52 64 73 77 87 94 103 107 111     
... >─>─>─>──>──>──>──>──>──>──>──>──>──>──>──>──>──>──>──>──>━━━>━━━>━━━> ...
    │ │ │ │  │  │  │  │  │  │  │  │  │  │  │  │  │  │  │  │  │   │   │   │    
                                 ...                                  
    117 134 136 133 140 135 141 143 138 142 128 129 127 124 123 109 123 11    
... ━━━>━━━>━━━>━━━>━━━●━━━<━━━<━━━<━━━<━━━<━━━<━━━<━━━<━━━<━━━<━━━<━━━<━━ ...
       │   │   │   │   │   │   │   │   │   │   │   │   │   │   │   │   │      
                                 ...                                  
    5 105 102 90 87 76 74 75 66 60 49 43 32 27 23 20 15 12 11 7 5 3 2 
    ━<━━━<━━━<──<──<──<──<──<──<──<──<──<──<──<──<──<──<──<──<─<─<─<─<
     │   │   │  │  │  │  │  │  │  │  │  │  │  │  │  │  │  │  │ │ │ │ │

Note some of the methods of Circuit may not be supported by CircuitMPS - it is recommended to work directly with the MPS tensor network.

8.2. CircuitPermMPS

Another simple variant is CircuitPermMPS, which is a subclass of CircuitMPS that uses the 'swap+split' to apply non-local 2-qubit gates, but doesn’t swap the qubits back, and instead lazily tracks the qubit locations. This can be quite advantageous for circuits without an expectation of locality, such as here:

circ = qtn.CircuitPermMPS.from_gates(
    gates=gen_gates(),
    max_bond=None,
    cutoff=1e-6,
    progbar=True,
)
max_bond=99, error~=0.00175: 100%|##########| 960/960 [00:10<00:00, 88.76it/s]  

You can see that the maximum bond dimension is lower, and the error is also lower. Note however that for efficiency the qubits are left in their swapped positions, and the circ.psi attribute now returns a generic TensorNetworkGenVector object with the indices and tags out of order:

tn = circ.psi
tn
TensorNetworkGenVector(tensors=64, indices=127)
Tensor(shape=(2, 2), inds=[_ee5449AAIZa, k0], tags={I0, PSI0}),backend=numpy, dtype=complex128, data=array([[-0.96560564+4.91419292e-21j, -0.25978125+1.09292731e-02j], [ 0.26001106+2.44636224e-18j, -0.96475222+4.05881502e-02j]])
Tensor(shape=(2, 4, 2), inds=[_ee5449AAIZa, _ee5449AAIZb, k28], tags={I28, PSI0}),backend=numpy, dtype=complex128, data=array([[[-9.89303372e-01+1.23025170e-04j, 8.54898696e-02+7.46861205e-03j], [ 3.96500431e-04+2.40256410e-04j, -3.18031447e-03-2.36832173e-03j], [ 5.89537414e-03-7.98841896e-07j, 5.02510459e-02+4.38490059e-03j], [ 3.06292631e-06+4.23537666e-07j, 2.13457383e-03+5.52232993e-04j]], [[-5.90070721e-03-1.68187637e-08j, -5.03264018e-02-4.39670209e-03j], [-6.62818515e-02-4.04345099e-02j, -5.42596518e-03-4.00814468e-03j], [ 4.55594022e-05+1.10569728e-05j, -2.96553771e-02-2.59957135e-03j], [-4.31311107e-04-7.13888109e-05j, 3.61644786e-03+9.37287747e-04j]]])
Tensor(shape=(4, 6, 2), inds=[_ee5449AAIZb, _ee5449AAIZc, k48], tags={I48, PSI0}),backend=numpy, dtype=complex128, data=array([[[ 9.98554899e-01-2.25189407e-07j, -5.95890904e-03+5.01464087e-02j], [-2.43644200e-04-1.40718263e-04j, 4.34114360e-03+1.31401406e-03j], [ 4.05354378e-05+1.89155010e-05j, 1.78152149e-04-3.52247426e-04j], [-1.28446178e-03-5.82640521e-04j, -1.25399202e-02+1.25006815e-02j], [ 9.48535766e-07+1.14036117e-06j, -1.62210020e-05-2.13976804e-05j], [ 4.51927891e-05+3.53817578e-05j, -1.09338720e-03-6.54910547e-04j]], [[ 3.37186710e-02+5.20108978e-03j, 1.95466163e-01-6.03713274e-01j], [ 6.42913909e-01+3.91262532e-01j, 7.88388087e-02+1.01384238e-02j], [-2.20989558e-02-1.34035486e-02j, -3.73092672e-03+3.19868403e-03j], [ 3.76772110e-03+2.31771726e-03j, 5.23161619e-02-1.39082963e-01j], [ 4.80568717e-05+5.80009684e-05j, -5.07059665e-04-1.70680192e-04j], [ 3.12851552e-03+2.20278872e-03j, -2.45212052e-02-2.69135702e-03j]], [[ 8.00220544e-05-3.17172041e-05j, -7.43939138e-04+7.41833549e-05j], [-3.44595036e-02-6.84580480e-05j, 4.42255696e-05-1.70852235e-03j], [-9.98217898e-01-1.23696186e-04j, 3.44271181e-03-4.80488501e-02j], [-2.97167505e-03+1.38837729e-04j, 3.16246612e-03-2.73336522e-03j], [-2.35862976e-04+7.93011639e-05j, 3.53463166e-03-2.26473221e-03j], [ 1.23827385e-04+1.02754264e-04j, 2.00310121e-03-1.21388605e-03j]], [[ 2.78797202e-04-2.29082236e-04j, -4.22110538e-03+1.14412852e-03j], [-9.01122280e-04+1.05905935e-03j, 1.34982430e-02-1.72750232e-02j], [ 2.54586596e-02+1.81458831e-02j, 4.13687346e-01-4.96766714e-01j], [-4.82526789e-03+2.23748711e-03j, 2.41270973e-02-2.73276083e-02j], [-7.53594832e-01-6.55153765e-02j, -7.64882211e-02+2.62561863e-02j], [ 8.12430391e-03-4.70461780e-04j, 1.56971273e-02-1.41164912e-02j]]])
Tensor(shape=(6, 7, 2), inds=[_ee5449AAIZc, _ee5449AAIZd, k37], tags={I37, PSI0}),backend=numpy, dtype=complex128, data=array([[[ 9.99364876e-01-2.98229797e-04j, 1.98825776e-02+4.73362135e-03j], [-1.26699659e-05+3.94394148e-06j, 8.63398293e-04+1.81892908e-05j], [-1.31773800e-05-1.28236492e-05j, -1.56010831e-03+1.86559806e-03j], [ 5.13233119e-04-1.27329801e-04j, -2.90309122e-02-1.27935351e-03j], [ 1.63998489e-05+9.61381219e-06j, 6.35027785e-04+1.01889259e-04j], [-5.02874253e-07-2.98673493e-07j, 5.44643119e-06+1.29695285e-06j], [ 4.54246212e-05-1.37274618e-05j, -4.67367137e-04+1.59756679e-04j]], [[ 1.12118540e-03-2.81134692e-04j, 7.41181117e-02-1.52271228e-01j], [ 3.81723930e-02+1.09050921e-02j, -1.26075536e-03+5.17181683e-03j], [-2.81326177e-01-9.30169128e-01j, -1.61549523e-02-6.84585693e-02j], [-1.56455959e-02+2.50475033e-02j, 6.65682469e-02-1.17983118e-01j], [ 5.58019703e-03-9.16171079e-03j, -2.49610656e-03+2.08956855e-03j], [-2.59080634e-05+1.35182989e-05j, 4.32395027e-04-1.56866693e-04j], [ 3.42344684e-04-1.90747887e-03j, -8.61752313e-03+3.13090677e-02j]], [[-2.02301274e-04+5.72944370e-05j, -2.24911325e-04+4.69272041e-03j], [ 9.98905704e-01-6.71314823e-04j, 2.21029438e-02+4.46187121e-03j], [ 2.18528929e-02+3.21467796e-02j, 8.31154774e-04+2.45595777e-03j], [ 8.28874295e-03-8.83692010e-04j, -6.04211371e-03+4.77744073e-03j], [-3.40380536e-04+3.41605281e-04j, 2.63263696e-03+1.79658404e-05j], [-6.16893539e-06+7.37319040e-06j, 1.17508539e-03+5.16081202e-04j], [-7.97623670e-05+8.35192322e-05j, -3.71493914e-04-9.56008914e-04j]], [[ 1.01430322e-02-5.71008540e-03j, -4.82355574e-01+8.80261306e-02j], [ 5.50300328e-04+6.79469944e-04j, 4.31335811e-03+1.18904391e-03j], [ 6.10011499e-02-6.78090008e-02j, -1.06783733e-02-1.29974727e-03j], [-5.06473795e-02-1.12882344e-03j, 3.60193392e-02-5.52250477e-02j], [-8.51192939e-01-2.88876742e-03j, 1.12794501e-01+2.57317252e-03j], [-1.76477220e-04-6.91994511e-05j, -9.11679192e-04-3.92973629e-04j], [ 9.78819958e-03-5.32334804e-03j, 7.35648589e-02-3.57175303e-02j]], [[-6.69909934e-04+4.23686545e-04j, 1.26798773e-02-8.49144132e-03j], [ 2.87507915e-03-1.64024193e-03j, -1.50699171e-01+4.31432259e-02j], [ 5.11650711e-04+7.12295333e-04j, -3.75758022e-03-2.66149298e-03j], [ 1.64604194e-03+4.81860357e-03j, -2.01887562e-02+7.50928235e-03j], [-8.93340153e-03+2.03974578e-03j, 1.32113704e-02-4.94689158e-03j], [ 9.54911576e-01+2.41318275e-01j, 6.15775453e-02+2.04851520e-02j], [ 7.11939847e-03-5.20360889e-03j, -2.83559438e-03+1.10959717e-03j]], [[-1.79105007e-02+5.95332740e-03j, 7.30369824e-01-2.29906598e-01j], [-2.05585355e-03-1.65504562e-03j, -5.30241391e-03+7.62449514e-03j], [-3.57321977e-02+1.26677346e-01j, -8.87714460e-02-3.39779847e-01j], [-1.40354418e-02+2.46177279e-02j, -1.66671085e-01-5.77719217e-02j], [-4.48472492e-01+2.40183122e-02j, 7.99672161e-02-1.58431923e-01j], [-2.12267261e-02-1.07135235e-02j, -4.35309154e-04+3.65147968e-04j], [ 2.53152225e-03-7.22604936e-03j, -8.27912644e-02-5.72415195e-04j]]])
Tensor(shape=(7, 10, 2), inds=[_ee5449AAIZd, _ee5449AAIZe, k62], tags={I62, PSI0}),backend=numpy, dtype=complex128, data=...
Tensor(shape=(10, 14, 2), inds=[_ee5449AAIZe, _ee5449AAIZf, k57], tags={I57, PSI0}),backend=numpy, dtype=complex128, data=...
Tensor(shape=(14, 17, 2), inds=[_ee5449AAIZf, _ee5449AAIZg, k2], tags={I2, PSI0}),backend=numpy, dtype=complex128, data=...
Tensor(shape=(17, 18, 2), inds=[_ee5449AAIZg, _ee5449AAIZh, k11], tags={I11, PSI0}),backend=numpy, dtype=complex128, data=...
Tensor(shape=(18, 23, 2), inds=[_ee5449AAIZh, _ee5449AAIZi, k7], tags={I7, PSI0}),backend=numpy, dtype=complex128, data=...
Tensor(shape=(23, 27, 2), inds=[_ee5449AAIZi, _ee5449AAIZj, k6], tags={I6, PSI0}),backend=numpy, dtype=complex128, data=...
Tensor(shape=(27, 27, 2), inds=[_ee5449AAIZj, _ee5449AAIZk, k10], tags={I10, PSI0}),backend=numpy, dtype=complex128, data=...
Tensor(shape=(27, 30, 2), inds=[_ee5449AAIZk, _ee5449AAIZl, k3], tags={I3, PSI0}),backend=numpy, dtype=complex128, data=...
Tensor(shape=(30, 28, 2), inds=[_ee5449AAIZl, _ee5449AAIZm, k56], tags={I56, PSI0}),backend=numpy, dtype=complex128, data=...
Tensor(shape=(28, 33, 2), inds=[_ee5449AAIZm, _ee5449AAIZn, k43], tags={I43, PSI0}),backend=numpy, dtype=complex128, data=...
Tensor(shape=(33, 35, 2), inds=[_ee5449AAIZn, _ee5449AAIZo, k20], tags={I20, PSI0}),backend=numpy, dtype=complex128, data=...
Tensor(shape=(35, 36, 2), inds=[_ee5449AAIZo, _ee5449AAIZp, k19], tags={I19, PSI0}),backend=numpy, dtype=complex128, data=...
Tensor(shape=(36, 49, 2), inds=[_ee5449AAIZp, _ee5449AAIZq, k50], tags={I50, PSI0}),backend=numpy, dtype=complex128, data=...
Tensor(shape=(49, 43, 2), inds=[_ee5449AAIZq, _ee5449AAIZr, k15], tags={I15, PSI0}),backend=numpy, dtype=complex128, data=...
Tensor(shape=(43, 63, 2), inds=[_ee5449AAIZr, _ee5449AAIZs, k16], tags={I16, PSI0}),backend=numpy, dtype=complex128, data=...
Tensor(shape=(63, 65, 2), inds=[_ee5449AAIZs, _ee5449AAIZt, k38], tags={I38, PSI0}),backend=numpy, dtype=complex128, data=...
Tensor(shape=(65, 72, 2), inds=[_ee5449AAIZt, _ee5449AAIZu, k21], tags={I21, PSI0}),backend=numpy, dtype=complex128, data=...
Tensor(shape=(72, 72, 2), inds=[_ee5449AAIZu, _ee5449AAIZv, k31], tags={I31, PSI0}),backend=numpy, dtype=complex128, data=...
Tensor(shape=(72, 82, 2), inds=[_ee5449AAIZv, _ee5449AAIZw, k8], tags={I8, PSI0}),backend=numpy, dtype=complex128, data=...
Tensor(shape=(82, 66, 2), inds=[_ee5449AAIZw, _ee5449AAIZx, k13], tags={I13, PSI0}),backend=numpy, dtype=complex128, data=...
Tensor(shape=(66, 75, 2), inds=[_ee5449AAIZx, _ee5449AAIZy, k23], tags={I23, PSI0}),backend=numpy, dtype=complex128, data=...
Tensor(shape=(75, 77, 2), inds=[_ee5449AAIZy, _ee5449AAIZz, k49], tags={I49, PSI0}),backend=numpy, dtype=complex128, data=...
Tensor(shape=(77, 86, 2), inds=[_ee5449AAIZz, _ee5449AAIaA, k59], tags={I59, PSI0}),backend=numpy, dtype=complex128, data=...
Tensor(shape=(86, 88, 2), inds=[_ee5449AAIaA, _ee5449AAIaB, k58], tags={I58, PSI0}),backend=numpy, dtype=complex128, data=...
Tensor(shape=(88, 95, 2), inds=[_ee5449AAIaB, _ee5449AAIaC, k32], tags={I32, PSI0}),backend=numpy, dtype=complex128, data=...
Tensor(shape=(95, 92, 2), inds=[_ee5449AAIaC, _ee5449AAIaD, k33], tags={I33, PSI0}),backend=numpy, dtype=complex128, data=...
Tensor(shape=(92, 98, 2), inds=[_ee5449AAIaD, _ee5449AAIaE, k52], tags={I52, PSI0}),backend=numpy, dtype=complex128, data=...
Tensor(shape=(98, 90, 2), inds=[_ee5449AAIaE, _ee5449AAIaF, k47], tags={I47, PSI0}),backend=numpy, dtype=complex128, data=...
Tensor(shape=(90, 85, 2), inds=[_ee5449AAIaF, _ee5449AAIaG, k42], tags={I42, PSI0}),backend=numpy, dtype=complex128, data=...
Tensor(shape=(85, 82, 2), inds=[_ee5449AAIaG, _ee5449AAIaH, k17], tags={I17, PSI0}),backend=numpy, dtype=complex128, data=...
Tensor(shape=(82, 87, 2), inds=[_ee5449AAIaH, _ee5449AAIaI, k44], tags={I44, PSI0}),backend=numpy, dtype=complex128, data=...
Tensor(shape=(87, 88, 2), inds=[_ee5449AAIaI, _ee5449AAIaJ, k4], tags={I4, PSI0}),backend=numpy, dtype=complex128, data=...
Tensor(shape=(88, 82, 2), inds=[_ee5449AAIaJ, _ee5449AAIaK, k29], tags={I29, PSI0}),backend=numpy, dtype=complex128, data=...
Tensor(shape=(82, 82, 2), inds=[_ee5449AAIaK, _ee5449AAIaL, k46], tags={I46, PSI0}),backend=numpy, dtype=complex128, data=...
Tensor(shape=(82, 95, 2), inds=[_ee5449AAIaL, _ee5449AAIaM, k40], tags={I40, PSI0}),backend=numpy, dtype=complex128, data=...
Tensor(shape=(95, 99, 2), inds=[_ee5449AAIaM, _ee5449AAIaN, k24], tags={I24, PSI0}),backend=numpy, dtype=complex128, data=...
Tensor(shape=(99, 96, 2), inds=[_ee5449AAIaN, _ee5449AAIaO, k39], tags={I39, PSI0}),backend=numpy, dtype=complex128, data=...
Tensor(shape=(96, 80, 2), inds=[_ee5449AAIaO, _ee5449AAIaP, k53], tags={I53, PSI0}),backend=numpy, dtype=complex128, data=...
Tensor(shape=(80, 85, 2), inds=[_ee5449AAIaP, _ee5449AAIaQ, k41], tags={I41, PSI0}),backend=numpy, dtype=complex128, data=...
Tensor(shape=(85, 74, 2), inds=[_ee5449AAIaQ, _ee5449AAIaR, k1], tags={I1, PSI0}),backend=numpy, dtype=complex128, data=...
Tensor(shape=(74, 68, 2), inds=[_ee5449AAIaR, _ee5449AAIaS, k35], tags={I35, PSI0}),backend=numpy, dtype=complex128, data=...
Tensor(shape=(68, 68, 2), inds=[_ee5449AAIaS, _ee5449AAIaT, k9], tags={I9, PSI0}),backend=numpy, dtype=complex128, data=...
Tensor(shape=(68, 71, 2), inds=[_ee5449AAIaT, _ee5449AAIaU, k51], tags={I51, PSI0}),backend=numpy, dtype=complex128, data=...
Tensor(shape=(71, 63, 2), inds=[_ee5449AAIaU, _ee5449AAIaV, k14], tags={I14, PSI0}),backend=numpy, dtype=complex128, data=...
Tensor(shape=(63, 60, 2), inds=[_ee5449AAIaV, _ee5449AAIaW, k61], tags={I61, PSI0}),backend=numpy, dtype=complex128, data=...
Tensor(shape=(60, 56, 2), inds=[_ee5449AAIaW, _ee5449AAIaX, k36], tags={I36, PSI0}),backend=numpy, dtype=complex128, data=...
Tensor(shape=(56, 48, 2), inds=[_ee5449AAIaX, _ee5449AAIaY, k12], tags={I12, PSI0}),backend=numpy, dtype=complex128, data=...
Tensor(shape=(48, 44, 2), inds=[_ee5449AAIaY, _ee5449AAIaZ, k60], tags={I60, PSI0}),backend=numpy, dtype=complex128, data=...
Tensor(shape=(44, 37, 2), inds=[_ee5449AAIaZ, _ee5449AAIaa, k45], tags={I45, PSI0}),backend=numpy, dtype=complex128, data=...
Tensor(shape=(37, 30, 2), inds=[_ee5449AAIaa, _ee5449AAIab, k27], tags={I27, PSI0}),backend=numpy, dtype=complex128, data=...
Tensor(shape=(30, 25, 2), inds=[_ee5449AAIab, _ee5449AAIac, k25], tags={I25, PSI0}),backend=numpy, dtype=complex128, data=...
Tensor(shape=(25, 20, 2), inds=[_ee5449AAIac, _ee5449AAIad, k18], tags={I18, PSI0}),backend=numpy, dtype=complex128, data=...
Tensor(shape=(20, 16, 2), inds=[_ee5449AAIad, _ee5449AAIae, k30], tags={I30, PSI0}),backend=numpy, dtype=complex128, data=...
Tensor(shape=(16, 12, 2), inds=[_ee5449AAIae, _ee5449AAIaf, k63], tags={I63, PSI0}),backend=numpy, dtype=complex128, data=...
Tensor(shape=(12, 9, 2), inds=[_ee5449AAIaf, _ee5449AAIag, k26], tags={I26, PSI0}),backend=numpy, dtype=complex128, data=...
Tensor(shape=(9, 5, 2), inds=[_ee5449AAIag, _ee5449AAIah, k22], tags={I22, PSI0}),backend=numpy, dtype=complex128, data=array([[[-9.99299350e-01+0.00000000e+00j, -6.31517207e-03-3.26103683e-02j], [ 4.26443455e-05-2.73868169e-05j, -1.25938140e-03-6.99863547e-04j], [-1.29306476e-04+5.11391868e-05j, 2.26017563e-03+1.15027429e-03j], [-9.66653880e-04+3.48512087e-04j, 1.50788703e-02+7.71686879e-03j], [ 5.26677236e-05-1.93088262e-05j, -8.50837117e-04-5.05965843e-04j]], [[ 3.41867867e-02+0.00000000e+00j, -2.55958324e-01-9.50665018e-01j], [-1.47423848e-02-4.13826044e-02j, 2.81892469e-03-4.06242492e-03j], [ 1.71222380e-02+1.50804995e-02j, 1.07327542e-03+2.11778528e-02j], [-3.18687394e-04+1.28240223e-02j, 1.75018545e-02+1.61512839e-01j], [-9.56373064e-04-1.78922779e-03j, -6.75452089e-04-8.13808304e-03j]], [[-1.52005263e-03+0.00000000e+00j, 1.43963618e-02+3.78688933e-02j], [-4.21561907e-01-9.03929965e-01j, 2.72431000e-02-1.61793691e-02j], [-2.70982480e-02-3.63002238e-02j, 9.78075152e-04-3.89270239e-03j], [-6.10728509e-03-1.22133827e-02j, -3.14808803e-03-1.68056666e-02j], [ 3.01152531e-04+6.36484867e-04j, 3.58711813e-04+1.01841596e-03j]], [[ 1.10714668e-03+0.00000000e+00j, -8.93728096e-03-1.98651588e-02j], [ 3.33671807e-02+2.82636960e-02j, -2.16265828e-03-3.53315890e-05j], [-8.74076055e-01-4.80840413e-01j, 1.47910557e-02-2.58580119e-02j], [ 2.78142352e-02+1.63159357e-02j, 1.28878294e-02+1.71543130e-02j], [-1.15217602e-03-7.80714740e-04j, -8.61908051e-04-7.98202659e-04j]], [[-3.46152254e-03+0.00000000e+00j, -1.45498557e-02-2.86385076e-03j], [-1.22485053e-02-1.59814861e-03j, 8.56456339e-03+3.44022223e-03j], [ 2.77629595e-02+1.27652669e-03j, -2.14943735e-02-5.87100744e-03j], [ 9.72825094e-01+6.25201174e-02j, -1.61926623e-01-2.69286331e-02j], [ 1.43254715e-01+1.91794415e-02j, 8.18656308e-03+7.86562653e-03j]], [[-1.16497785e-03+0.00000000e+00j, -6.90177630e-03-1.78445695e-03j], [-1.88455727e-03+4.68050159e-04j, 9.78407948e-04-3.37965445e-05j], [ 4.37329198e-03-1.30586695e-03j, -2.37444926e-03-2.88395559e-03j], [ 1.32526877e-01-3.15204023e-02j, -6.19353739e-02-1.75354417e-02j], [-9.78758251e-01+1.34952092e-01j, 9.74924060e-03-3.05464902e-02j]], [[ 1.46488030e-02+0.00000000e+00j, 1.63918130e-01-1.26918929e-03j], [-1.13268943e-02-2.63667661e-03j, -1.22260914e-01-5.34185448e-02j], [ 2.22700850e-02+4.41063293e-04j, 1.21745149e-01+1.12012730e-04j], [ 1.71774304e-01+3.76785681e-03j, 9.40752831e-01+1.42014775e-01j], [-3.79176609e-02+1.79369541e-02j, -5.37236073e-02-1.75976848e-02j]], [[-5.87168955e-04+0.00000000e+00j, -1.81844172e-02-1.75902667e-03j], [ 1.90660249e-02-2.62876102e-02j, -8.70344432e-01-4.58197163e-01j], [-1.02335304e-03-3.26721225e-03j, -1.32908907e-01+6.95317113e-03j], [-1.36892546e-02-3.18903354e-04j, -1.10885666e-01-2.77013445e-02j], [ 4.92799137e-03-1.86952481e-03j, 1.20645260e-02+4.31211798e-03j]], [[-5.12928430e-04+0.00000000e+00j, -2.12510658e-03+4.36627537e-03j], [-2.74462927e-03-4.94836535e-04j, 6.07187367e-04+1.16657061e-01j], [ 2.66491023e-02-1.41273070e-02j, -5.22645839e-01-8.32043463e-01j], [-4.64488827e-03+4.74022608e-03j, 5.50617921e-02+1.29710971e-01j], [-3.67019664e-03-5.86065946e-03j, -6.31004104e-03+2.44352676e-03j]]])
Tensor(shape=(5, 4, 2), inds=[_ee5449AAIah, _ee5449AAIai, k55], tags={I55, PSI0}),backend=numpy, dtype=complex128, data=array([[[ 9.90302217e-01+1.06319363e-08j, -1.32841645e-01+3.64651347e-02j], [ 1.93279961e-05+1.34281847e-06j, 1.04073559e-04-2.19230029e-05j], [-4.27725999e-04+1.96802833e-06j, -2.85224786e-03+8.11881549e-04j], [ 2.70398725e-03+5.51469962e-07j, 1.69501759e-02-4.61522807e-03j]], [[-1.74862168e-02+5.30412511e-06j, -1.19115799e-01+3.26620105e-02j], [ 9.18595652e-01-3.48678249e-01j, -1.09551128e-01+8.00233195e-02j], [ 1.86581202e-02-7.52446106e-04j, -2.33127384e-03+3.25947102e-04j], [ 1.38513944e-03+4.22112467e-04j, 1.60634742e-02-4.98110348e-03j]], [[ 1.36083210e-01+2.06053998e-06j, 9.27794919e-01-2.54377009e-01j], [ 1.17570278e-01-4.47378931e-02j, -1.62439672e-02+1.05996919e-02j], [-1.52793708e-01+5.30928052e-03j, 2.70478204e-02-7.15681308e-03j], [-1.87700997e-02+4.23355853e-04j, -1.18560759e-01+3.46951869e-02j]], [[-2.16592823e-02-1.60436183e-05j, -1.45936240e-01+3.98532767e-02j], [-1.10950224e-03+3.68585175e-04j, 2.99792572e-05-6.05722882e-04j], [-9.75418280e-01+3.20615196e-02j, 1.08482153e-01-3.23217166e-02j], [-9.66226470e-02+2.64195683e-03j, 4.31834163e-02-1.24062237e-02j]], [[-2.13669880e-03-1.21951794e-05j, 2.11196878e-02-5.65784320e-03j], [ 1.02574226e-03+1.68871118e-04j, 7.99029329e-04-7.00195334e-05j], [-9.70016452e-02-1.55910799e-03j, -1.87259401e-02+4.68857881e-03j], [ 9.85503012e-01+2.00081463e-02j, 1.29472067e-01-3.67659670e-02j]]])
Tensor(shape=(4, 3, 2), inds=[_ee5449AAIai, _ee5449AAIaj, k5], tags={I5, PSI0}),backend=numpy, dtype=complex128, data=array([[[ 9.97989423e-01-1.68952464e-09j, 6.28239570e-02+8.38112227e-03j], [ 6.40939381e-06-3.80348749e-06j, -1.11982283e-04+4.01112506e-05j], [ 8.94306167e-07-2.30201929e-07j, -5.92780471e-05-1.35847930e-05j]], [[-3.64454488e-04+8.19024307e-07j, 5.69951395e-03+7.44060086e-04j], [ 9.69179163e-01+2.37542722e-01j, 6.08870105e-02+2.29074438e-02j], [-1.33017683e-04-1.94726584e-06j, -1.55509977e-04-1.18234449e-04j]], [[ 9.81717847e-03-3.62334199e-06j, -1.53187199e-01-2.03864349e-02j], [ 9.82004093e-04+2.36617329e-04j, 3.45677124e-04+1.83356891e-04j], [ 9.85561268e-01+3.41355389e-02j, 5.86794512e-02+8.99990822e-03j]], [[-6.26127150e-02+6.07388756e-07j, 9.77255997e-01+1.30363989e-01j], [-5.53438620e-03-1.41591020e-03j, 2.65056456e-04+7.70110093e-04j], [ 1.54084104e-01+5.31608713e-03j, 1.54810321e-02+3.53028118e-03j]]])
Tensor(shape=(3, 2, 2), inds=[_ee5449AAIaj, _ee5449AAIak, k34], tags={I34, PSI0}),backend=numpy, dtype=complex128, data=array([[[ 0.99578447-2.47805034e-07j, -0.09007306+4.12868757e-03j], [-0.00189868+2.37498401e-06j, -0.0166995 +7.78150708e-04j]], [[ 0.09168285-1.50648068e-05j, 0.97717042-4.47635975e-02j], [ 0.04938998-8.02085199e-03j, 0.17931149-8.49338433e-03j]], [[-0.00269868-3.01903553e-04j, -0.06484672+5.52783116e-03j], [ 0.98178507-1.59709108e-01j, 0.07775361-1.73901552e-02j]]])
Tensor(shape=(2, 2), inds=[_ee5449AAIak, k54], tags={I54, PSI0}),backend=numpy, dtype=complex128, data=array([[-0.99591146+6.74047903e-23j, 0.09017207+5.41900732e-03j], [-0.09033476+4.09634070e-19j, -0.99411792-5.97428029e-02j]])
tn.draw(tn.site_tags, node_scale=0.5)
_images/43bff5f6ea239385a5bd930df72f390f2b43b39f40c61774c29782a021272e30.svg

To get the non-reindexed and non-retagged MPS you can call CircuitPermMPS.get_psi_unordered:

mps = circ.get_psi_unordered()
mps
MatrixProductState(tensors=64, indices=127, L=64, max_bond=99)
Tensor(shape=(2, 2), inds=[_ee5449AAIZa, k0], tags={I0, PSI0}),backend=numpy, dtype=complex128, data=array([[-0.96560564+4.91419292e-21j, -0.25978125+1.09292731e-02j], [ 0.26001106+2.44636224e-18j, -0.96475222+4.05881502e-02j]])
Tensor(shape=(2, 4, 2), inds=[_ee5449AAIZa, _ee5449AAIZb, k1], tags={I1, PSI0}),backend=numpy, dtype=complex128, data=array([[[-9.89303372e-01+1.23025170e-04j, 8.54898696e-02+7.46861205e-03j], [ 3.96500431e-04+2.40256410e-04j, -3.18031447e-03-2.36832173e-03j], [ 5.89537414e-03-7.98841896e-07j, 5.02510459e-02+4.38490059e-03j], [ 3.06292631e-06+4.23537666e-07j, 2.13457383e-03+5.52232993e-04j]], [[-5.90070721e-03-1.68187637e-08j, -5.03264018e-02-4.39670209e-03j], [-6.62818515e-02-4.04345099e-02j, -5.42596518e-03-4.00814468e-03j], [ 4.55594022e-05+1.10569728e-05j, -2.96553771e-02-2.59957135e-03j], [-4.31311107e-04-7.13888109e-05j, 3.61644786e-03+9.37287747e-04j]]])
Tensor(shape=(4, 6, 2), inds=[_ee5449AAIZb, _ee5449AAIZc, k2], tags={I2, PSI0}),backend=numpy, dtype=complex128, data=array([[[ 9.98554899e-01-2.25189407e-07j, -5.95890904e-03+5.01464087e-02j], [-2.43644200e-04-1.40718263e-04j, 4.34114360e-03+1.31401406e-03j], [ 4.05354378e-05+1.89155010e-05j, 1.78152149e-04-3.52247426e-04j], [-1.28446178e-03-5.82640521e-04j, -1.25399202e-02+1.25006815e-02j], [ 9.48535766e-07+1.14036117e-06j, -1.62210020e-05-2.13976804e-05j], [ 4.51927891e-05+3.53817578e-05j, -1.09338720e-03-6.54910547e-04j]], [[ 3.37186710e-02+5.20108978e-03j, 1.95466163e-01-6.03713274e-01j], [ 6.42913909e-01+3.91262532e-01j, 7.88388087e-02+1.01384238e-02j], [-2.20989558e-02-1.34035486e-02j, -3.73092672e-03+3.19868403e-03j], [ 3.76772110e-03+2.31771726e-03j, 5.23161619e-02-1.39082963e-01j], [ 4.80568717e-05+5.80009684e-05j, -5.07059665e-04-1.70680192e-04j], [ 3.12851552e-03+2.20278872e-03j, -2.45212052e-02-2.69135702e-03j]], [[ 8.00220544e-05-3.17172041e-05j, -7.43939138e-04+7.41833549e-05j], [-3.44595036e-02-6.84580480e-05j, 4.42255696e-05-1.70852235e-03j], [-9.98217898e-01-1.23696186e-04j, 3.44271181e-03-4.80488501e-02j], [-2.97167505e-03+1.38837729e-04j, 3.16246612e-03-2.73336522e-03j], [-2.35862976e-04+7.93011639e-05j, 3.53463166e-03-2.26473221e-03j], [ 1.23827385e-04+1.02754264e-04j, 2.00310121e-03-1.21388605e-03j]], [[ 2.78797202e-04-2.29082236e-04j, -4.22110538e-03+1.14412852e-03j], [-9.01122280e-04+1.05905935e-03j, 1.34982430e-02-1.72750232e-02j], [ 2.54586596e-02+1.81458831e-02j, 4.13687346e-01-4.96766714e-01j], [-4.82526789e-03+2.23748711e-03j, 2.41270973e-02-2.73276083e-02j], [-7.53594832e-01-6.55153765e-02j, -7.64882211e-02+2.62561863e-02j], [ 8.12430391e-03-4.70461780e-04j, 1.56971273e-02-1.41164912e-02j]]])
Tensor(shape=(6, 7, 2), inds=[_ee5449AAIZc, _ee5449AAIZd, k3], tags={I3, PSI0}),backend=numpy, dtype=complex128, data=array([[[ 9.99364876e-01-2.98229797e-04j, 1.98825776e-02+4.73362135e-03j], [-1.26699659e-05+3.94394148e-06j, 8.63398293e-04+1.81892908e-05j], [-1.31773800e-05-1.28236492e-05j, -1.56010831e-03+1.86559806e-03j], [ 5.13233119e-04-1.27329801e-04j, -2.90309122e-02-1.27935351e-03j], [ 1.63998489e-05+9.61381219e-06j, 6.35027785e-04+1.01889259e-04j], [-5.02874253e-07-2.98673493e-07j, 5.44643119e-06+1.29695285e-06j], [ 4.54246212e-05-1.37274618e-05j, -4.67367137e-04+1.59756679e-04j]], [[ 1.12118540e-03-2.81134692e-04j, 7.41181117e-02-1.52271228e-01j], [ 3.81723930e-02+1.09050921e-02j, -1.26075536e-03+5.17181683e-03j], [-2.81326177e-01-9.30169128e-01j, -1.61549523e-02-6.84585693e-02j], [-1.56455959e-02+2.50475033e-02j, 6.65682469e-02-1.17983118e-01j], [ 5.58019703e-03-9.16171079e-03j, -2.49610656e-03+2.08956855e-03j], [-2.59080634e-05+1.35182989e-05j, 4.32395027e-04-1.56866693e-04j], [ 3.42344684e-04-1.90747887e-03j, -8.61752313e-03+3.13090677e-02j]], [[-2.02301274e-04+5.72944370e-05j, -2.24911325e-04+4.69272041e-03j], [ 9.98905704e-01-6.71314823e-04j, 2.21029438e-02+4.46187121e-03j], [ 2.18528929e-02+3.21467796e-02j, 8.31154774e-04+2.45595777e-03j], [ 8.28874295e-03-8.83692010e-04j, -6.04211371e-03+4.77744073e-03j], [-3.40380536e-04+3.41605281e-04j, 2.63263696e-03+1.79658404e-05j], [-6.16893539e-06+7.37319040e-06j, 1.17508539e-03+5.16081202e-04j], [-7.97623670e-05+8.35192322e-05j, -3.71493914e-04-9.56008914e-04j]], [[ 1.01430322e-02-5.71008540e-03j, -4.82355574e-01+8.80261306e-02j], [ 5.50300328e-04+6.79469944e-04j, 4.31335811e-03+1.18904391e-03j], [ 6.10011499e-02-6.78090008e-02j, -1.06783733e-02-1.29974727e-03j], [-5.06473795e-02-1.12882344e-03j, 3.60193392e-02-5.52250477e-02j], [-8.51192939e-01-2.88876742e-03j, 1.12794501e-01+2.57317252e-03j], [-1.76477220e-04-6.91994511e-05j, -9.11679192e-04-3.92973629e-04j], [ 9.78819958e-03-5.32334804e-03j, 7.35648589e-02-3.57175303e-02j]], [[-6.69909934e-04+4.23686545e-04j, 1.26798773e-02-8.49144132e-03j], [ 2.87507915e-03-1.64024193e-03j, -1.50699171e-01+4.31432259e-02j], [ 5.11650711e-04+7.12295333e-04j, -3.75758022e-03-2.66149298e-03j], [ 1.64604194e-03+4.81860357e-03j, -2.01887562e-02+7.50928235e-03j], [-8.93340153e-03+2.03974578e-03j, 1.32113704e-02-4.94689158e-03j], [ 9.54911576e-01+2.41318275e-01j, 6.15775453e-02+2.04851520e-02j], [ 7.11939847e-03-5.20360889e-03j, -2.83559438e-03+1.10959717e-03j]], [[-1.79105007e-02+5.95332740e-03j, 7.30369824e-01-2.29906598e-01j], [-2.05585355e-03-1.65504562e-03j, -5.30241391e-03+7.62449514e-03j], [-3.57321977e-02+1.26677346e-01j, -8.87714460e-02-3.39779847e-01j], [-1.40354418e-02+2.46177279e-02j, -1.66671085e-01-5.77719217e-02j], [-4.48472492e-01+2.40183122e-02j, 7.99672161e-02-1.58431923e-01j], [-2.12267261e-02-1.07135235e-02j, -4.35309154e-04+3.65147968e-04j], [ 2.53152225e-03-7.22604936e-03j, -8.27912644e-02-5.72415195e-04j]]])
Tensor(shape=(7, 10, 2), inds=[_ee5449AAIZd, _ee5449AAIZe, k4], tags={I4, PSI0}),backend=numpy, dtype=complex128, data=...
Tensor(shape=(10, 14, 2), inds=[_ee5449AAIZe, _ee5449AAIZf, k5], tags={I5, PSI0}),backend=numpy, dtype=complex128, data=...
Tensor(shape=(14, 17, 2), inds=[_ee5449AAIZf, _ee5449AAIZg, k6], tags={I6, PSI0}),backend=numpy, dtype=complex128, data=...
Tensor(shape=(17, 18, 2), inds=[_ee5449AAIZg, _ee5449AAIZh, k7], tags={I7, PSI0}),backend=numpy, dtype=complex128, data=...
Tensor(shape=(18, 23, 2), inds=[_ee5449AAIZh, _ee5449AAIZi, k8], tags={I8, PSI0}),backend=numpy, dtype=complex128, data=...
Tensor(shape=(23, 27, 2), inds=[_ee5449AAIZi, _ee5449AAIZj, k9], tags={I9, PSI0}),backend=numpy, dtype=complex128, data=...
Tensor(shape=(27, 27, 2), inds=[_ee5449AAIZj, _ee5449AAIZk, k10], tags={I10, PSI0}),backend=numpy, dtype=complex128, data=...
Tensor(shape=(27, 30, 2), inds=[_ee5449AAIZk, _ee5449AAIZl, k11], tags={I11, PSI0}),backend=numpy, dtype=complex128, data=...
Tensor(shape=(30, 28, 2), inds=[_ee5449AAIZl, _ee5449AAIZm, k12], tags={I12, PSI0}),backend=numpy, dtype=complex128, data=...
Tensor(shape=(28, 33, 2), inds=[_ee5449AAIZm, _ee5449AAIZn, k13], tags={I13, PSI0}),backend=numpy, dtype=complex128, data=...
Tensor(shape=(33, 35, 2), inds=[_ee5449AAIZn, _ee5449AAIZo, k14], tags={I14, PSI0}),backend=numpy, dtype=complex128, data=...
Tensor(shape=(35, 36, 2), inds=[_ee5449AAIZo, _ee5449AAIZp, k15], tags={I15, PSI0}),backend=numpy, dtype=complex128, data=...
Tensor(shape=(36, 49, 2), inds=[_ee5449AAIZp, _ee5449AAIZq, k16], tags={I16, PSI0}),backend=numpy, dtype=complex128, data=...
Tensor(shape=(49, 43, 2), inds=[_ee5449AAIZq, _ee5449AAIZr, k17], tags={I17, PSI0}),backend=numpy, dtype=complex128, data=...
Tensor(shape=(43, 63, 2), inds=[_ee5449AAIZr, _ee5449AAIZs, k18], tags={I18, PSI0}),backend=numpy, dtype=complex128, data=...
Tensor(shape=(63, 65, 2), inds=[_ee5449AAIZs, _ee5449AAIZt, k19], tags={I19, PSI0}),backend=numpy, dtype=complex128, data=...
Tensor(shape=(65, 72, 2), inds=[_ee5449AAIZt, _ee5449AAIZu, k20], tags={I20, PSI0}),backend=numpy, dtype=complex128, data=...
Tensor(shape=(72, 72, 2), inds=[_ee5449AAIZu, _ee5449AAIZv, k21], tags={I21, PSI0}),backend=numpy, dtype=complex128, data=...
Tensor(shape=(72, 82, 2), inds=[_ee5449AAIZv, _ee5449AAIZw, k22], tags={I22, PSI0}),backend=numpy, dtype=complex128, data=...
Tensor(shape=(82, 66, 2), inds=[_ee5449AAIZw, _ee5449AAIZx, k23], tags={I23, PSI0}),backend=numpy, dtype=complex128, data=...
Tensor(shape=(66, 75, 2), inds=[_ee5449AAIZx, _ee5449AAIZy, k24], tags={I24, PSI0}),backend=numpy, dtype=complex128, data=...
Tensor(shape=(75, 77, 2), inds=[_ee5449AAIZy, _ee5449AAIZz, k25], tags={I25, PSI0}),backend=numpy, dtype=complex128, data=...
Tensor(shape=(77, 86, 2), inds=[_ee5449AAIZz, _ee5449AAIaA, k26], tags={I26, PSI0}),backend=numpy, dtype=complex128, data=...
Tensor(shape=(86, 88, 2), inds=[_ee5449AAIaA, _ee5449AAIaB, k27], tags={I27, PSI0}),backend=numpy, dtype=complex128, data=...
Tensor(shape=(88, 95, 2), inds=[_ee5449AAIaB, _ee5449AAIaC, k28], tags={I28, PSI0}),backend=numpy, dtype=complex128, data=...
Tensor(shape=(95, 92, 2), inds=[_ee5449AAIaC, _ee5449AAIaD, k29], tags={I29, PSI0}),backend=numpy, dtype=complex128, data=...
Tensor(shape=(92, 98, 2), inds=[_ee5449AAIaD, _ee5449AAIaE, k30], tags={I30, PSI0}),backend=numpy, dtype=complex128, data=...
Tensor(shape=(98, 90, 2), inds=[_ee5449AAIaE, _ee5449AAIaF, k31], tags={I31, PSI0}),backend=numpy, dtype=complex128, data=...
Tensor(shape=(90, 85, 2), inds=[_ee5449AAIaF, _ee5449AAIaG, k32], tags={I32, PSI0}),backend=numpy, dtype=complex128, data=...
Tensor(shape=(85, 82, 2), inds=[_ee5449AAIaG, _ee5449AAIaH, k33], tags={I33, PSI0}),backend=numpy, dtype=complex128, data=...
Tensor(shape=(82, 87, 2), inds=[_ee5449AAIaH, _ee5449AAIaI, k34], tags={I34, PSI0}),backend=numpy, dtype=complex128, data=...
Tensor(shape=(87, 88, 2), inds=[_ee5449AAIaI, _ee5449AAIaJ, k35], tags={I35, PSI0}),backend=numpy, dtype=complex128, data=...
Tensor(shape=(88, 82, 2), inds=[_ee5449AAIaJ, _ee5449AAIaK, k36], tags={I36, PSI0}),backend=numpy, dtype=complex128, data=...
Tensor(shape=(82, 82, 2), inds=[_ee5449AAIaK, _ee5449AAIaL, k37], tags={I37, PSI0}),backend=numpy, dtype=complex128, data=...
Tensor(shape=(82, 95, 2), inds=[_ee5449AAIaL, _ee5449AAIaM, k38], tags={I38, PSI0}),backend=numpy, dtype=complex128, data=...
Tensor(shape=(95, 99, 2), inds=[_ee5449AAIaM, _ee5449AAIaN, k39], tags={I39, PSI0}),backend=numpy, dtype=complex128, data=...
Tensor(shape=(99, 96, 2), inds=[_ee5449AAIaN, _ee5449AAIaO, k40], tags={I40, PSI0}),backend=numpy, dtype=complex128, data=...
Tensor(shape=(96, 80, 2), inds=[_ee5449AAIaO, _ee5449AAIaP, k41], tags={I41, PSI0}),backend=numpy, dtype=complex128, data=...
Tensor(shape=(80, 85, 2), inds=[_ee5449AAIaP, _ee5449AAIaQ, k42], tags={I42, PSI0}),backend=numpy, dtype=complex128, data=...
Tensor(shape=(85, 74, 2), inds=[_ee5449AAIaQ, _ee5449AAIaR, k43], tags={I43, PSI0}),backend=numpy, dtype=complex128, data=...
Tensor(shape=(74, 68, 2), inds=[_ee5449AAIaR, _ee5449AAIaS, k44], tags={I44, PSI0}),backend=numpy, dtype=complex128, data=...
Tensor(shape=(68, 68, 2), inds=[_ee5449AAIaS, _ee5449AAIaT, k45], tags={I45, PSI0}),backend=numpy, dtype=complex128, data=...
Tensor(shape=(68, 71, 2), inds=[_ee5449AAIaT, _ee5449AAIaU, k46], tags={I46, PSI0}),backend=numpy, dtype=complex128, data=...
Tensor(shape=(71, 63, 2), inds=[_ee5449AAIaU, _ee5449AAIaV, k47], tags={I47, PSI0}),backend=numpy, dtype=complex128, data=...
Tensor(shape=(63, 60, 2), inds=[_ee5449AAIaV, _ee5449AAIaW, k48], tags={I48, PSI0}),backend=numpy, dtype=complex128, data=...
Tensor(shape=(60, 56, 2), inds=[_ee5449AAIaW, _ee5449AAIaX, k49], tags={I49, PSI0}),backend=numpy, dtype=complex128, data=...
Tensor(shape=(56, 48, 2), inds=[_ee5449AAIaX, _ee5449AAIaY, k50], tags={I50, PSI0}),backend=numpy, dtype=complex128, data=...
Tensor(shape=(48, 44, 2), inds=[_ee5449AAIaY, _ee5449AAIaZ, k51], tags={I51, PSI0}),backend=numpy, dtype=complex128, data=...
Tensor(shape=(44, 37, 2), inds=[_ee5449AAIaZ, _ee5449AAIaa, k52], tags={I52, PSI0}),backend=numpy, dtype=complex128, data=...
Tensor(shape=(37, 30, 2), inds=[_ee5449AAIaa, _ee5449AAIab, k53], tags={I53, PSI0}),backend=numpy, dtype=complex128, data=...
Tensor(shape=(30, 25, 2), inds=[_ee5449AAIab, _ee5449AAIac, k54], tags={I54, PSI0}),backend=numpy, dtype=complex128, data=...
Tensor(shape=(25, 20, 2), inds=[_ee5449AAIac, _ee5449AAIad, k55], tags={I55, PSI0}),backend=numpy, dtype=complex128, data=...
Tensor(shape=(20, 16, 2), inds=[_ee5449AAIad, _ee5449AAIae, k56], tags={I56, PSI0}),backend=numpy, dtype=complex128, data=...
Tensor(shape=(16, 12, 2), inds=[_ee5449AAIae, _ee5449AAIaf, k57], tags={I57, PSI0}),backend=numpy, dtype=complex128, data=...
Tensor(shape=(12, 9, 2), inds=[_ee5449AAIaf, _ee5449AAIag, k58], tags={I58, PSI0}),backend=numpy, dtype=complex128, data=...
Tensor(shape=(9, 5, 2), inds=[_ee5449AAIag, _ee5449AAIah, k59], tags={I59, PSI0}),backend=numpy, dtype=complex128, data=array([[[-9.99299350e-01+0.00000000e+00j, -6.31517207e-03-3.26103683e-02j], [ 4.26443455e-05-2.73868169e-05j, -1.25938140e-03-6.99863547e-04j], [-1.29306476e-04+5.11391868e-05j, 2.26017563e-03+1.15027429e-03j], [-9.66653880e-04+3.48512087e-04j, 1.50788703e-02+7.71686879e-03j], [ 5.26677236e-05-1.93088262e-05j, -8.50837117e-04-5.05965843e-04j]], [[ 3.41867867e-02+0.00000000e+00j, -2.55958324e-01-9.50665018e-01j], [-1.47423848e-02-4.13826044e-02j, 2.81892469e-03-4.06242492e-03j], [ 1.71222380e-02+1.50804995e-02j, 1.07327542e-03+2.11778528e-02j], [-3.18687394e-04+1.28240223e-02j, 1.75018545e-02+1.61512839e-01j], [-9.56373064e-04-1.78922779e-03j, -6.75452089e-04-8.13808304e-03j]], [[-1.52005263e-03+0.00000000e+00j, 1.43963618e-02+3.78688933e-02j], [-4.21561907e-01-9.03929965e-01j, 2.72431000e-02-1.61793691e-02j], [-2.70982480e-02-3.63002238e-02j, 9.78075152e-04-3.89270239e-03j], [-6.10728509e-03-1.22133827e-02j, -3.14808803e-03-1.68056666e-02j], [ 3.01152531e-04+6.36484867e-04j, 3.58711813e-04+1.01841596e-03j]], [[ 1.10714668e-03+0.00000000e+00j, -8.93728096e-03-1.98651588e-02j], [ 3.33671807e-02+2.82636960e-02j, -2.16265828e-03-3.53315890e-05j], [-8.74076055e-01-4.80840413e-01j, 1.47910557e-02-2.58580119e-02j], [ 2.78142352e-02+1.63159357e-02j, 1.28878294e-02+1.71543130e-02j], [-1.15217602e-03-7.80714740e-04j, -8.61908051e-04-7.98202659e-04j]], [[-3.46152254e-03+0.00000000e+00j, -1.45498557e-02-2.86385076e-03j], [-1.22485053e-02-1.59814861e-03j, 8.56456339e-03+3.44022223e-03j], [ 2.77629595e-02+1.27652669e-03j, -2.14943735e-02-5.87100744e-03j], [ 9.72825094e-01+6.25201174e-02j, -1.61926623e-01-2.69286331e-02j], [ 1.43254715e-01+1.91794415e-02j, 8.18656308e-03+7.86562653e-03j]], [[-1.16497785e-03+0.00000000e+00j, -6.90177630e-03-1.78445695e-03j], [-1.88455727e-03+4.68050159e-04j, 9.78407948e-04-3.37965445e-05j], [ 4.37329198e-03-1.30586695e-03j, -2.37444926e-03-2.88395559e-03j], [ 1.32526877e-01-3.15204023e-02j, -6.19353739e-02-1.75354417e-02j], [-9.78758251e-01+1.34952092e-01j, 9.74924060e-03-3.05464902e-02j]], [[ 1.46488030e-02+0.00000000e+00j, 1.63918130e-01-1.26918929e-03j], [-1.13268943e-02-2.63667661e-03j, -1.22260914e-01-5.34185448e-02j], [ 2.22700850e-02+4.41063293e-04j, 1.21745149e-01+1.12012730e-04j], [ 1.71774304e-01+3.76785681e-03j, 9.40752831e-01+1.42014775e-01j], [-3.79176609e-02+1.79369541e-02j, -5.37236073e-02-1.75976848e-02j]], [[-5.87168955e-04+0.00000000e+00j, -1.81844172e-02-1.75902667e-03j], [ 1.90660249e-02-2.62876102e-02j, -8.70344432e-01-4.58197163e-01j], [-1.02335304e-03-3.26721225e-03j, -1.32908907e-01+6.95317113e-03j], [-1.36892546e-02-3.18903354e-04j, -1.10885666e-01-2.77013445e-02j], [ 4.92799137e-03-1.86952481e-03j, 1.20645260e-02+4.31211798e-03j]], [[-5.12928430e-04+0.00000000e+00j, -2.12510658e-03+4.36627537e-03j], [-2.74462927e-03-4.94836535e-04j, 6.07187367e-04+1.16657061e-01j], [ 2.66491023e-02-1.41273070e-02j, -5.22645839e-01-8.32043463e-01j], [-4.64488827e-03+4.74022608e-03j, 5.50617921e-02+1.29710971e-01j], [-3.67019664e-03-5.86065946e-03j, -6.31004104e-03+2.44352676e-03j]]])
Tensor(shape=(5, 4, 2), inds=[_ee5449AAIah, _ee5449AAIai, k60], tags={I60, PSI0}),backend=numpy, dtype=complex128, data=array([[[ 9.90302217e-01+1.06319363e-08j, -1.32841645e-01+3.64651347e-02j], [ 1.93279961e-05+1.34281847e-06j, 1.04073559e-04-2.19230029e-05j], [-4.27725999e-04+1.96802833e-06j, -2.85224786e-03+8.11881549e-04j], [ 2.70398725e-03+5.51469962e-07j, 1.69501759e-02-4.61522807e-03j]], [[-1.74862168e-02+5.30412511e-06j, -1.19115799e-01+3.26620105e-02j], [ 9.18595652e-01-3.48678249e-01j, -1.09551128e-01+8.00233195e-02j], [ 1.86581202e-02-7.52446106e-04j, -2.33127384e-03+3.25947102e-04j], [ 1.38513944e-03+4.22112467e-04j, 1.60634742e-02-4.98110348e-03j]], [[ 1.36083210e-01+2.06053998e-06j, 9.27794919e-01-2.54377009e-01j], [ 1.17570278e-01-4.47378931e-02j, -1.62439672e-02+1.05996919e-02j], [-1.52793708e-01+5.30928052e-03j, 2.70478204e-02-7.15681308e-03j], [-1.87700997e-02+4.23355853e-04j, -1.18560759e-01+3.46951869e-02j]], [[-2.16592823e-02-1.60436183e-05j, -1.45936240e-01+3.98532767e-02j], [-1.10950224e-03+3.68585175e-04j, 2.99792572e-05-6.05722882e-04j], [-9.75418280e-01+3.20615196e-02j, 1.08482153e-01-3.23217166e-02j], [-9.66226470e-02+2.64195683e-03j, 4.31834163e-02-1.24062237e-02j]], [[-2.13669880e-03-1.21951794e-05j, 2.11196878e-02-5.65784320e-03j], [ 1.02574226e-03+1.68871118e-04j, 7.99029329e-04-7.00195334e-05j], [-9.70016452e-02-1.55910799e-03j, -1.87259401e-02+4.68857881e-03j], [ 9.85503012e-01+2.00081463e-02j, 1.29472067e-01-3.67659670e-02j]]])
Tensor(shape=(4, 3, 2), inds=[_ee5449AAIai, _ee5449AAIaj, k61], tags={I61, PSI0}),backend=numpy, dtype=complex128, data=array([[[ 9.97989423e-01-1.68952464e-09j, 6.28239570e-02+8.38112227e-03j], [ 6.40939381e-06-3.80348749e-06j, -1.11982283e-04+4.01112506e-05j], [ 8.94306167e-07-2.30201929e-07j, -5.92780471e-05-1.35847930e-05j]], [[-3.64454488e-04+8.19024307e-07j, 5.69951395e-03+7.44060086e-04j], [ 9.69179163e-01+2.37542722e-01j, 6.08870105e-02+2.29074438e-02j], [-1.33017683e-04-1.94726584e-06j, -1.55509977e-04-1.18234449e-04j]], [[ 9.81717847e-03-3.62334199e-06j, -1.53187199e-01-2.03864349e-02j], [ 9.82004093e-04+2.36617329e-04j, 3.45677124e-04+1.83356891e-04j], [ 9.85561268e-01+3.41355389e-02j, 5.86794512e-02+8.99990822e-03j]], [[-6.26127150e-02+6.07388756e-07j, 9.77255997e-01+1.30363989e-01j], [-5.53438620e-03-1.41591020e-03j, 2.65056456e-04+7.70110093e-04j], [ 1.54084104e-01+5.31608713e-03j, 1.54810321e-02+3.53028118e-03j]]])
Tensor(shape=(3, 2, 2), inds=[_ee5449AAIaj, _ee5449AAIak, k62], tags={I62, PSI0}),backend=numpy, dtype=complex128, data=array([[[ 0.99578447-2.47805034e-07j, -0.09007306+4.12868757e-03j], [-0.00189868+2.37498401e-06j, -0.0166995 +7.78150708e-04j]], [[ 0.09168285-1.50648068e-05j, 0.97717042-4.47635975e-02j], [ 0.04938998-8.02085199e-03j, 0.17931149-8.49338433e-03j]], [[-0.00269868-3.01903553e-04j, -0.06484672+5.52783116e-03j], [ 0.98178507-1.59709108e-01j, 0.07775361-1.73901552e-02j]]])
Tensor(shape=(2, 2), inds=[_ee5449AAIak, k63], tags={I63, PSI0}),backend=numpy, dtype=complex128, data=array([[-0.99591146+6.74047903e-23j, 0.09017207+5.41900732e-03j], [-0.09033476+4.09634070e-19j, -0.99411792-5.97428029e-02j]])

The current qubit ordering is stored in circ.qubits and so the mapping of qubits to the physical sites of this MPS can be calculated like so:

{q: circ.qubits.index(q) for q in range(circ.N)}
{0: 0,
 1: 43,
 2: 6,
 3: 11,
 4: 35,
 5: 61,
 6: 9,
 7: 8,
 8: 22,
 9: 45,
 10: 10,
 11: 7,
 12: 50,
 13: 23,
 14: 47,
 15: 17,
 16: 18,
 17: 33,
 18: 55,
 19: 15,
 20: 14,
 21: 20,
 22: 59,
 23: 24,
 24: 39,
 25: 54,
 26: 58,
 27: 53,
 28: 1,
 29: 36,
 30: 56,
 31: 21,
 32: 28,
 33: 29,
 34: 62,
 35: 44,
 36: 49,
 37: 3,
 38: 19,
 39: 40,
 40: 38,
 41: 42,
 42: 32,
 43: 13,
 44: 34,
 45: 52,
 46: 37,
 47: 31,
 48: 2,
 49: 25,
 50: 16,
 51: 46,
 52: 30,
 53: 41,
 54: 63,
 55: 60,
 56: 12,
 57: 5,
 58: 27,
 59: 26,
 60: 51,
 61: 48,
 62: 4,
 63: 57}

8.3. Using a GPU or other backends

We can make use of GPUs or other accelerated backends by simply supplying a function that converts the initial tensors and gates to the desired backend. Here we’ll use the torch backend, with single precision complex tensors on the GPU:

import torch

def to_backend(x):
    return torch.tensor(x, dtype=torch.complex64, device="cuda")

We can then attempt a deeper circuit:

circ = qtn.CircuitPermMPS.from_gates(
    # add 5 more layers of gates
    gen_gates(depth=15),
    cutoff=1e-6,
    # impose a hard bond dimension limit
    max_bond=1024,
    to_backend=to_backend,
    progbar=True,
)
max_bond=1021, error~=0.272: 100%|##########| 1440/1440 [04:32<00:00,  5.28it/s] 
mps = circ.get_psi_unordered()
# convert back to numpy
mps.apply_to_arrays(lambda x: x.cpu().numpy())
mps
MatrixProductState(tensors=64, indices=127, L=64, max_bond=1021)
Tensor(shape=(2, 2), inds=[_ee5449AAOLe, k0], tags={I0, PSI0}),backend=numpy, dtype=complex64, data=array([[ 0.9983962 -2.4160619e-12j, 0.05661165-2.2753939e-04j], [ 0.05426549-1.6130317e-02j, -0.9558608 +2.8831422e-01j]], dtype=complex64)
Tensor(shape=(2, 4, 2), inds=[_ee5449AAOLe, _ee5449AAOLf, k1], tags={I1, PSI0}),backend=numpy, dtype=complex64, data=array([[[ 7.7327287e-01+5.0316368e-05j, 2.9520956e-01-8.8291168e-02j], [ 5.4402752e-03-1.9685170e-03j, 2.0104591e-03+1.3598918e-03j], [ 3.5645809e-02-1.0156715e-02j, -7.7668592e-02+4.9348943e-02j], [-1.9088853e-05+8.4765641e-05j, -1.1393003e-03+2.5979981e-03j]], [[-1.8195353e-02-5.5630808e-03j, 4.3439422e-02-2.0239682e-05j], [ 1.3819507e-01+1.3002556e-02j, -4.8184745e-02+9.4910311e-03j], [-3.8507774e-03-1.3798841e-03j, -8.1839124e-03+3.2541296e-03j], [ 7.3562181e-03-5.2499613e-03j, 1.5762348e-02-1.9997459e-02j]]], dtype=complex64)
Tensor(shape=(4, 8, 2), inds=[_ee5449AAOLf, _ee5449AAOLg, k2], tags={I2, PSI0}),backend=numpy, dtype=complex64, data=array([[[ 9.65503395e-01-6.24093518e-05j, 1.27870753e-01+5.06331213e-02j], [-2.85760239e-02-1.74251888e-02j, 1.29419908e-01+1.73371539e-01j], [-1.09223300e-03+4.41109471e-04j, 2.88077854e-02-8.31278134e-03j], [-7.34475470e-05-4.35846632e-05j, -5.93354693e-04-2.79356118e-05j], [-5.69504191e-05-1.40986886e-04j, 2.35484098e-03-7.11532123e-03j], [ 9.05690104e-06+2.25640106e-05j, 9.91513298e-06+1.42679771e-03j], [-1.51727136e-05+2.90976709e-06j, -9.16214849e-05-6.31183793e-04j], [ 9.70417659e-07-2.36888377e-06j, 6.67575150e-05-9.99647636e-06j]], [[-9.62790996e-02-1.96330324e-02j, 1.68201745e-01+1.18223600e-01j], [-1.75099984e-01-1.32427067e-01j, 1.27981111e-01+2.63560146e-01j], [ 7.46928990e-01-4.62884784e-01j, -5.34077510e-02+9.36575700e-03j], [-1.56331956e-02-3.50264693e-03j, 3.77325993e-03+5.84915979e-03j], [-1.99147244e-03+2.05459911e-02j, -9.52859223e-02+1.66833609e-01j], [-8.48183932e-04-1.99627713e-03j, 2.27941643e-03-2.81634666e-02j], [-5.17894863e-04+3.75765783e-04j, 4.13420494e-04+2.19803937e-02j], [ 4.15622198e-05-8.21295398e-05j, -2.48569471e-04-2.65523733e-04j]], [[ 6.55877404e-03+2.02565541e-04j, -1.50606185e-02-3.60905821e-03j], [-3.57695576e-03+5.11151366e-03j, -1.22154588e-02-1.84163228e-02j], [ 2.38998961e-02-2.12305393e-02j, 1.70809124e-02-5.50840283e-03j], [ 9.62923229e-01+3.97307873e-02j, 1.08321451e-01+4.75455038e-02j], [ 1.79808505e-03+2.88563133e-05j, -9.23177321e-03-3.19200717e-02j], [ 4.05790890e-03-1.47284307e-02j, -5.20761795e-02+7.01392666e-02j], [-1.78163610e-02-1.88486855e-02j, 8.04139450e-02+1.97150201e-01j], [-2.54203391e-04+1.86174875e-04j, -8.48475657e-03+4.81064635e-04j]], [[ 1.69700421e-02+1.96229722e-02j, -1.64815653e-02-5.42362295e-02j], [ 4.36677889e-04+3.33948135e-02j, 1.27511369e-02-7.09232241e-02j], [ 4.61609997e-02+7.38830259e-03j, -1.12159401e-02-1.30335167e-02j], [-4.25221361e-02-3.20323221e-02j, 4.70296927e-02+8.24957490e-02j], [ 1.72839314e-01-1.09057598e-01j, -2.31497958e-02-3.64471320e-03j], [ 6.26528084e-01-6.17887557e-01j, -1.48330048e-01+5.07801361e-02j], [ 8.46826583e-02+2.81011552e-01j, -1.88223645e-02+8.45388398e-02j], [ 2.43712552e-02+2.31450843e-03j, 1.72249600e-01+1.01709284e-01j]]], dtype=complex64)
Tensor(shape=(8, 15, 2), inds=[_ee5449AAOLg, _ee5449AAOLh, k3], tags={I3, PSI0}),backend=numpy, dtype=complex64, data=...
Tensor(shape=(15, 25, 2), inds=[_ee5449AAOLh, _ee5449AAOLi, k4], tags={I4, PSI0}),backend=numpy, dtype=complex64, data=...
Tensor(shape=(25, 37, 2), inds=[_ee5449AAOLi, _ee5449AAOLj, k5], tags={I5, PSI0}),backend=numpy, dtype=complex64, data=...
Tensor(shape=(37, 53, 2), inds=[_ee5449AAOLj, _ee5449AAOLk, k6], tags={I6, PSI0}),backend=numpy, dtype=complex64, data=...
Tensor(shape=(53, 72, 2), inds=[_ee5449AAOLk, _ee5449AAOLl, k7], tags={I7, PSI0}),backend=numpy, dtype=complex64, data=...
Tensor(shape=(72, 91, 2), inds=[_ee5449AAOLl, _ee5449AAOLm, k8], tags={I8, PSI0}),backend=numpy, dtype=complex64, data=...
Tensor(shape=(91, 103, 2), inds=[_ee5449AAOLm, _ee5449AAOLn, k9], tags={I9, PSI0}),backend=numpy, dtype=complex64, data=...
Tensor(shape=(103, 117, 2), inds=[_ee5449AAOLn, _ee5449AAOLo, k10], tags={I10, PSI0}),backend=numpy, dtype=complex64, data=...
Tensor(shape=(117, 146, 2), inds=[_ee5449AAOLo, _ee5449AAOLp, k11], tags={I11, PSI0}),backend=numpy, dtype=complex64, data=...
Tensor(shape=(146, 186, 2), inds=[_ee5449AAOLp, _ee5449AAOLq, k12], tags={I12, PSI0}),backend=numpy, dtype=complex64, data=...
Tensor(shape=(186, 196, 2), inds=[_ee5449AAOLq, _ee5449AAOLr, k13], tags={I13, PSI0}),backend=numpy, dtype=complex64, data=...
Tensor(shape=(196, 247, 2), inds=[_ee5449AAOLr, _ee5449AAOLs, k14], tags={I14, PSI0}),backend=numpy, dtype=complex64, data=...
Tensor(shape=(247, 317, 2), inds=[_ee5449AAOLs, _ee5449AAOLt, k15], tags={I15, PSI0}),backend=numpy, dtype=complex64, data=...
Tensor(shape=(317, 337, 2), inds=[_ee5449AAOLt, _ee5449AAOLu, k16], tags={I16, PSI0}),backend=numpy, dtype=complex64, data=...
Tensor(shape=(337, 384, 2), inds=[_ee5449AAOLu, _ee5449AAOLv, k17], tags={I17, PSI0}),backend=numpy, dtype=complex64, data=...
Tensor(shape=(384, 410, 2), inds=[_ee5449AAOLv, _ee5449AAOLw, k18], tags={I18, PSI0}),backend=numpy, dtype=complex64, data=...
Tensor(shape=(410, 464, 2), inds=[_ee5449AAOLw, _ee5449AAOLx, k19], tags={I19, PSI0}),backend=numpy, dtype=complex64, data=...
Tensor(shape=(464, 504, 2), inds=[_ee5449AAOLx, _ee5449AAOLy, k20], tags={I20, PSI0}),backend=numpy, dtype=complex64, data=...
Tensor(shape=(504, 600, 2), inds=[_ee5449AAOLy, _ee5449AAOLz, k21], tags={I21, PSI0}),backend=numpy, dtype=complex64, data=...
Tensor(shape=(600, 721, 2), inds=[_ee5449AAOLz, _ee5449AAOMA, k22], tags={I22, PSI0}),backend=numpy, dtype=complex64, data=...
Tensor(shape=(721, 796, 2), inds=[_ee5449AAOMA, _ee5449AAOMB, k23], tags={I23, PSI0}),backend=numpy, dtype=complex64, data=...
Tensor(shape=(796, 856, 2), inds=[_ee5449AAOMB, _ee5449AAOMC, k24], tags={I24, PSI0}),backend=numpy, dtype=complex64, data=...
Tensor(shape=(856, 856, 2), inds=[_ee5449AAOMC, _ee5449AAOMD, k25], tags={I25, PSI0}),backend=numpy, dtype=complex64, data=...
Tensor(shape=(856, 886, 2), inds=[_ee5449AAOMD, _ee5449AAOME, k26], tags={I26, PSI0}),backend=numpy, dtype=complex64, data=...
Tensor(shape=(886, 916, 2), inds=[_ee5449AAOME, _ee5449AAOMF, k27], tags={I27, PSI0}),backend=numpy, dtype=complex64, data=...
Tensor(shape=(916, 991, 2), inds=[_ee5449AAOMF, _ee5449AAOMG, k28], tags={I28, PSI0}),backend=numpy, dtype=complex64, data=...
Tensor(shape=(991, 1021, 2), inds=[_ee5449AAOMG, _ee5449AAOMH, k29], tags={I29, PSI0}),backend=numpy, dtype=complex64, data=...
Tensor(shape=(1021, 1006, 2), inds=[_ee5449AAOMH, _ee5449AAOMI, k30], tags={I30, PSI0}),backend=numpy, dtype=complex64, data=...
Tensor(shape=(1006, 916, 2), inds=[_ee5449AAOMI, _ee5449AAOMJ, k31], tags={I31, PSI0}),backend=numpy, dtype=complex64, data=...
Tensor(shape=(916, 750, 2), inds=[_ee5449AAOMJ, _ee5449AAOMK, k32], tags={I32, PSI0}),backend=numpy, dtype=complex64, data=...
Tensor(shape=(750, 750, 2), inds=[_ee5449AAOMK, _ee5449AAOML, k33], tags={I33, PSI0}),backend=numpy, dtype=complex64, data=...
Tensor(shape=(750, 766, 2), inds=[_ee5449AAOML, _ee5449AAOMM, k34], tags={I34, PSI0}),backend=numpy, dtype=complex64, data=...
Tensor(shape=(766, 721, 2), inds=[_ee5449AAOMM, _ee5449AAOMN, k35], tags={I35, PSI0}),backend=numpy, dtype=complex64, data=...
Tensor(shape=(721, 706, 2), inds=[_ee5449AAOMN, _ee5449AAOMO, k36], tags={I36, PSI0}),backend=numpy, dtype=complex64, data=...
Tensor(shape=(706, 563, 2), inds=[_ee5449AAOMO, _ee5449AAOMP, k37], tags={I37, PSI0}),backend=numpy, dtype=complex64, data=...
Tensor(shape=(563, 537, 2), inds=[_ee5449AAOMP, _ee5449AAOMQ, k38], tags={I38, PSI0}),backend=numpy, dtype=complex64, data=...
Tensor(shape=(537, 507, 2), inds=[_ee5449AAOMQ, _ee5449AAOMR, k39], tags={I39, PSI0}),backend=numpy, dtype=complex64, data=...
Tensor(shape=(507, 493, 2), inds=[_ee5449AAOMR, _ee5449AAOMS, k40], tags={I40, PSI0}),backend=numpy, dtype=complex64, data=...
Tensor(shape=(493, 429, 2), inds=[_ee5449AAOMS, _ee5449AAOMT, k41], tags={I41, PSI0}),backend=numpy, dtype=complex64, data=...
Tensor(shape=(429, 371, 2), inds=[_ee5449AAOMT, _ee5449AAOMU, k42], tags={I42, PSI0}),backend=numpy, dtype=complex64, data=...
Tensor(shape=(371, 351, 2), inds=[_ee5449AAOMU, _ee5449AAOMV, k43], tags={I43, PSI0}),backend=numpy, dtype=complex64, data=...
Tensor(shape=(351, 346, 2), inds=[_ee5449AAOMV, _ee5449AAOMW, k44], tags={I44, PSI0}),backend=numpy, dtype=complex64, data=...
Tensor(shape=(346, 311, 2), inds=[_ee5449AAOMW, _ee5449AAOMX, k45], tags={I45, PSI0}),backend=numpy, dtype=complex64, data=...
Tensor(shape=(311, 273, 2), inds=[_ee5449AAOMX, _ee5449AAOMY, k46], tags={I46, PSI0}),backend=numpy, dtype=complex64, data=...
Tensor(shape=(273, 267, 2), inds=[_ee5449AAOMY, _ee5449AAOMZ, k47], tags={I47, PSI0}),backend=numpy, dtype=complex64, data=...
Tensor(shape=(267, 235, 2), inds=[_ee5449AAOMZ, _ee5449AAOMa, k48], tags={I48, PSI0}),backend=numpy, dtype=complex64, data=...
Tensor(shape=(235, 186, 2), inds=[_ee5449AAOMa, _ee5449AAOMb, k49], tags={I49, PSI0}),backend=numpy, dtype=complex64, data=...
Tensor(shape=(186, 164, 2), inds=[_ee5449AAOMb, _ee5449AAOMc, k50], tags={I50, PSI0}),backend=numpy, dtype=complex64, data=...
Tensor(shape=(164, 134, 2), inds=[_ee5449AAOMc, _ee5449AAOMd, k51], tags={I51, PSI0}),backend=numpy, dtype=complex64, data=...
Tensor(shape=(134, 110, 2), inds=[_ee5449AAOMd, _ee5449AAOMe, k52], tags={I52, PSI0}),backend=numpy, dtype=complex64, data=...
Tensor(shape=(110, 84, 2), inds=[_ee5449AAOMe, _ee5449AAOMf, k53], tags={I53, PSI0}),backend=numpy, dtype=complex64, data=...
Tensor(shape=(84, 79, 2), inds=[_ee5449AAOMf, _ee5449AAOMg, k54], tags={I54, PSI0}),backend=numpy, dtype=complex64, data=...
Tensor(shape=(79, 62, 2), inds=[_ee5449AAOMg, _ee5449AAOMh, k55], tags={I55, PSI0}),backend=numpy, dtype=complex64, data=...
Tensor(shape=(62, 45, 2), inds=[_ee5449AAOMh, _ee5449AAOMi, k56], tags={I56, PSI0}),backend=numpy, dtype=complex64, data=...
Tensor(shape=(45, 31, 2), inds=[_ee5449AAOMi, _ee5449AAOMj, k57], tags={I57, PSI0}),backend=numpy, dtype=complex64, data=...
Tensor(shape=(31, 23, 2), inds=[_ee5449AAOMj, _ee5449AAOMk, k58], tags={I58, PSI0}),backend=numpy, dtype=complex64, data=...
Tensor(shape=(23, 14, 2), inds=[_ee5449AAOMk, _ee5449AAOMl, k59], tags={I59, PSI0}),backend=numpy, dtype=complex64, data=...
Tensor(shape=(14, 7, 2), inds=[_ee5449AAOMl, _ee5449AAOMm, k60], tags={I60, PSI0}),backend=numpy, dtype=complex64, data=...
Tensor(shape=(7, 4, 2), inds=[_ee5449AAOMm, _ee5449AAOMn, k61], tags={I61, PSI0}),backend=numpy, dtype=complex64, data=array([[[ 9.96236980e-01+2.4070632e-08j, 7.89629221e-02+3.4836203e-02j], [ 7.85438053e-04+1.3493551e-03j, 3.86000465e-06-7.7864886e-03j], [-3.07907067e-05+4.1298550e-05j, -1.74091445e-04-6.0549745e-04j], [-6.33264517e-06+1.0163743e-05j, 8.19765701e-05-1.7924360e-05j]], [[ 2.91674002e-03-1.8520071e-03j, -2.98597179e-02+6.3157629e-04j], [-9.50842917e-01+2.9104754e-01j, -9.70625728e-02+2.7532874e-02j], [ 1.01774577e-02+5.3521578e-04j, -5.00710274e-04+1.4484661e-03j], [ 7.69868784e-05+8.8001480e-06j, -1.44594989e-04+1.1705145e-04j]], [[ 6.95380266e-04-8.6132996e-03j, -4.66696434e-02+8.6333320e-02j], [-2.67639733e-03-1.2591273e-02j, 1.15524465e-02-2.3635915e-03j], [ 1.44219860e-01-9.8215419e-01j, 3.19165848e-02-5.9365232e-02j], [-6.82235579e-04-5.4200133e-04j, 2.50299089e-03+3.6452424e-03j]], [[ 5.20012304e-02+6.8666242e-02j, -2.26194963e-01-9.5790952e-01j], [ 2.18018163e-02+1.7246410e-02j, -8.19127113e-02+7.9877868e-02j], [-5.40758595e-02-8.2671881e-02j, -3.53236636e-03-1.3851826e-02j], [-2.06969329e-04-7.2022912e-04j, 4.10932611e-04+1.9045428e-05j]], [[ 2.16604420e-03-3.1289419e-06j, -1.13828696e-01-8.6599207e-03j], [ 4.76607047e-02+8.9024976e-02j, -4.17614192e-01-8.9195538e-01j], [ 5.02990745e-03+1.6479675e-03j, -5.72904162e-02-3.5829116e-02j], [ 2.92633139e-02-3.6426760e-02j, -1.88175717e-03-5.2322319e-04j]], [[-1.11391593e-04+3.7153200e-06j, 3.29019409e-03-3.2021434e-03j], [-4.63805255e-03-3.5727155e-04j, 4.38987799e-02+5.6419009e-03j], [-4.19351680e-04+2.8612893e-03j, 1.31152254e-02-3.3428535e-02j], [-3.55564982e-01-9.2888469e-01j, -2.18382608e-02-8.3493821e-02j]], [[ 1.12551101e-03+6.4542535e-04j, -6.73710834e-03-1.3146271e-02j], [-1.34523027e-03+5.2274307e-03j, 2.15623397e-02-6.3469239e-02j], [-3.88851315e-02-5.6240056e-02j, 2.51932204e-01+9.5996392e-01j], [-2.12617535e-02-1.9569127e-02j, -6.76252022e-02-1.3219890e-02j]]], dtype=complex64)
Tensor(shape=(4, 2, 2), inds=[_ee5449AAOMn, _ee5449AAOMo, k62], tags={I62, PSI0}),backend=numpy, dtype=complex64, data=array([[[ 0.92607856-9.8399801e-07j, 0.31903595-2.0143587e-02j], [-0.07055734-4.4627250e-03j, 0.1875915 -1.9815541e-06j]], [[-0.37172192-1.2331456e-04j, 0.7954943 -5.0294854e-02j], [-0.00233152-2.0734944e-04j, 0.47589502+6.9912453e-04j]], [[ 0.05932834-1.2505287e-04j, 0.20936982-1.4789319e-02j], [ 0.926834 +5.4938756e-02j, -0.30063716+1.9048782e-03j]], [[ 0.01609367-2.0553790e-02j, -0.26616517+3.8415003e-01j], [ 0.2447539 -2.7028224e-01j, 0.50008726-6.3076097e-01j]]], dtype=complex64)
Tensor(shape=(2, 2), inds=[_ee5449AAOMo, k63], tags={I63, PSI0}),backend=numpy, dtype=complex64, data=array([[ 0.97433376-1.7703654e-12j, -0.22317576-2.9436558e-02j], [ 0.22466111-1.4189258e-02j, 0.9720776 +6.6268601e-02j]], dtype=complex64)

The MPS circuit simulators track the current orthogonality center so as to avoid uneccessary canonicalizations. However with only single precision this can be a meaninfully lossy assumption, meaning the global norm might be slightly different to that estimated above. We can check that here:

circ.gate_opts["info"]
{'cur_orthog': (1, 1)}
mps.show()
     2 4 8 15 25 37 53 72 91 103 117 146 186 196 247 317 337 384 410 464 5    
... >─●─●─●──●──●──●──●──●──●━━━●━━━●━━━●━━━●━━━●━━━●━━━●━━━●━━━●━━━●━━━●━ ...
    │ │ │ │  │  │  │  │  │  │   │   │   │   │   │   │   │   │   │   │   │     
                                 ...                                  
    04 600 721 796 856 856 886 916 991 1021 1006 916 750 750 766 721 706 5    
... ━━●━━━●━━━●━━━●━━━●━━━●━━━●━━━●━━━●━━━━●━━━━●━━━●━━━●━━━●━━━●━━━●━━━●━ ...
      │   │   │   │   │   │   │   │   │    │    │   │   │   │   │   │   │     
                                 ...                                  
    63 537 507 493 429 371 351 346 311 273 267 235 186 164 134 110 84 79 6    
... ━━●━━━●━━━●━━━●━━━●━━━●━━━●━━━●━━━●━━━●━━━●━━━●━━━●━━━●━━━●━━━●──●──●─ ...
      │   │   │   │   │   │   │   │   │   │   │   │   │   │   │   │  │  │     
                                 ...                                  
    2 45 31 23 14 7 4 2 
    ─●──●──●──<──<─<─<─<
     │  │  │  │  │ │ │ │
1 - abs(mps.norm())**2
0.2729898095130906