mindquantum.algorithm.nisq.Ansatz1

class mindquantum.algorithm.nisq.Ansatz1(n_qubits: int, depth: int, prefix: str = '', suffix: str = '')[source]

Ansatz 1 implement from arxiv paper.

../../_images/ansatz1.png

Please refers to Expressibility and entangling capability of parameterized quantum circuits for hybrid quantum-classical algorithms.

Parameters
  • n_qubits (int) – total qubits number of this ansatz.

  • depth (int) – depth of ansatz.

  • prefix (str) – prefix of parameters. Default: ''.

  • suffix (str) – suffix of parameters. Default: ''.

Examples

>>> from mindquantum.algorithm.nisq import Ansatz1
>>> Ansatz1(3, 2).circuit
      ┏━━━━━━━━┓ ┏━━━━━━━━┓ ┏━━━━━━━━┓ ┏━━━━━━━━┓
q0: ──┨ RX(p0) ┠─┨ RZ(p3) ┠─┨ RX(p6) ┠─┨ RZ(p9) ┠────
      ┗━━━━━━━━┛ ┗━━━━━━━━┛ ┗━━━━━━━━┛ ┗━━━━━━━━┛
      ┏━━━━━━━━┓ ┏━━━━━━━━┓ ┏━━━━━━━━┓ ┏━━━━━━━━━┓
q1: ──┨ RX(p1) ┠─┨ RZ(p4) ┠─┨ RX(p7) ┠─┨ RZ(p10) ┠───
      ┗━━━━━━━━┛ ┗━━━━━━━━┛ ┗━━━━━━━━┛ ┗━━━━━━━━━┛
      ┏━━━━━━━━┓ ┏━━━━━━━━┓ ┏━━━━━━━━┓ ┏━━━━━━━━━┓
q2: ──┨ RX(p2) ┠─┨ RZ(p5) ┠─┨ RX(p8) ┠─┨ RZ(p11) ┠───
      ┗━━━━━━━━┛ ┗━━━━━━━━┛ ┗━━━━━━━━┛ ┗━━━━━━━━━┛