import sys
sys.path.insert(0, '..')
import numpy as np
import qutip as qt
import src
from src import (utils, paulialg, stabilizer, circuit)

3.2. Clifford Layers#

CliffordLayer has the following attributes:

  • gates(list): contains a list of CliffordGate

  • prev_layer: Default None. It will be automatically setup in CliffordCircuit

  • next_layer: Default None. It will be automatically setup in CliffordCircuit

  • forward_map

  • backward_map

CliffordLayer can take CliffordGates by layer.take(gate):

circlayer = circuit.CliffordLayer()
circlayer.take(circuit.CliffordGate(0,1))
circlayer.take(circuit.CliffordGate(1,3))
circlayer
|[0,1][1,3]|
psi=stabilizer.random_clifford_state(4)
print(psi)
StabilizerState(
   +ZZIZ
   +XIXY
   +ZYIX
   +ZIZI)
circlayer.forward(psi)
StabilizerState(
   -XIIX
   -ZYXZ
   +YZIZ
   -YXZY)
If the forward map and backward map for a gate is Null, then it will be assigned a different random clifford map each time when use calls forward() or backward()