Sim14ansatz#

class discopy.quantum.ansatze.Sim14ansatz(n_qubits, params)[source]#

Bases:

Builds a modified version of circuit 14 from arXiv:1905.10876

Replaces circuit-block construction with two rings of CRx gates, in opposite orientation.

>>> pprint = lambda c: print(str(c.foliation()).replace(' >>', '\n  >>'))
>>> pprint(Sim14ansatz(3, [[i/10 for i in range(12)]]))
Ry(0) @ Ry(0.1) @ Ry(0.2)
  >> Controlled(Rx(0.3), distance=2)
  >> Controlled(Rx(0.4), distance=-1) @ qubit
  >> Ry(0.6) @ Controlled(Rx(0.5), distance=-1)
  >> qubit @ Ry(0.7) @ Ry(0.8)
  >> CRx(0.9) @ qubit
  >> Controlled(Rx(1), distance=-2)
  >> qubit @ CRx(1.1)
>>> print(Sim14ansatz(1, [0.1, 0.2, 0.3]))
Rx(0.1) >> Rz(0.2) >> Rx(0.3)
Return type:

Circuit