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

2.5. Methods for Clifford maps#

2.5.1. Embedding small Clifford map into larger map#

.embed(small_map, mask) provides the method to embed a smaller Clifford map on a subset of qubits to the current Clifford map. This is a in-place operation. The Clifford map object that provide this method will get modified under the embedding.

Parameters:

  • small_map is a CliffordMap object supported on a subset of qubits.

  • mask is a boolean array specifying the subset of qubits.

cmap = stabilizer.identity_map(6)
cmap
CliffordMap(
  X0-> +XIIIII
  Z0-> +ZIIIII
  X1-> +IXIIII
  Z1-> +IZIIII
  X2-> +IIXIII
  Z2-> +IIZIII
  X3-> +IIIXII
  Z3-> +IIIZII
  X4-> +IIIIXI
  Z4-> +IIIIZI
  X5-> +IIIIIX
  Z5-> +IIIIIZ)
cmap.embed(stabilizer.random_clifford_map(3), np.array([True,False,False,True,True,False]))
CliffordMap(
  X0-> +IIIZYI
  Z0-> -XIIXYI
  X1-> +IXIIII
  Z1-> +IZIIII
  X2-> +IIXIII
  Z2-> +IIZIII
  X3-> -YIIZYI
  Z3-> +ZIIZYI
  X4-> -IIIIYI
  Z4-> +IIIYXI
  X5-> +IIIIIX
  Z5-> +IIIIIZ)

2.5.2. Map Composition#

.compose(other) returns the composition of the current Clifford map with another Clifford map. This will return a new Clifford map without modifying either of the input maps. The Clifford map object which initiates this method will be the preceeding map in the composition.

Parameters:

  • other - another CliffordMap.

cmap.compose(stabilizer.random_clifford_map(6))
CliffordMap(
  X0-> -YZZYYZ
  Z0-> -ZIXIZI
  X1-> -ZYXXZY
  Z1-> -ZZIXII
  X2-> -YIZZZZ
  Z2-> +YIIZXZ
  X3-> -YZIYYI
  Z3-> +ZIYXXI
  X4-> -ZZYIXX
  Z4-> -ZZIXIZ
  X5-> -YXIXYZ
  Z5-> +ZIIXII)

2.5.3. Map Inversion#

.inverse() returns the inverse of the current Clifford map. This will return a new Clifford map withoutt modifying the original map. The inverse map is such that its composition with the original map must be identity

cmap = stabilizer.clifford_rotation_map('Y')
cmap
CliffordMap(
  X0-> -Z
  Z0-> +X)
cmap.inverse()
CliffordMap(
  X0-> +Z
  Z0-> -X)