Sim15ansatz

Contents

Sim15ansatz#

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

Bases:

Builds a modified version of circuit 15 from arXiv:1905.10876

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

>>> pprint = lambda c: print(str(c.foliation()).replace(' >>', '\n  >>'))
>>> pprint(Sim15ansatz(3, [[0.1, 0.2, 0.3, 0.4, 0.5, 0.6]]))
Ry(0.1) @ Ry(0.2) @ Ry(0.3)
  >> Controlled(X, distance=2)
  >> Controlled(X, distance=-1) @ qubit
  >> Ry(0.4) @ Controlled(X, distance=-1)
  >> qubit @ Ry(0.5) @ Ry(0.6)
  >> CX @ qubit
  >> Controlled(X, distance=-2)
  >> qubit @ CX
>>> print(Sim15ansatz(1, [0.1, 0.2, 0.3]))
Rx(0.1) >> Rz(0.2) >> Rx(0.3)
Return type:

Circuit