mindquantum.algorithm.nisq.Ansatz3

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

Ansatz 3 implement from arxiv paper.

../../_images/ansatz3.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 Ansatz3
>>> Ansatz3(3, 1).circuit
      ┏━━━━━━━━┓ ┏━━━━━━━━┓            ┏━━━━━━━━┓
q0: ──┨ RX(p0) ┠─┨ RZ(p3) ┠────────────┨ RZ(p7) ┠───
      ┗━━━━━━━━┛ ┗━━━━━━━━┛            ┗━━━━┳━━━┛
      ┏━━━━━━━━┓ ┏━━━━━━━━┓ ┏━━━━━━━━┓      ┃
q1: ──┨ RX(p1) ┠─┨ RZ(p4) ┠─┨ RZ(p6) ┠──────■───────
      ┗━━━━━━━━┛ ┗━━━━━━━━┛ ┗━━━━┳━━━┛
      ┏━━━━━━━━┓ ┏━━━━━━━━┓      ┃
q2: ──┨ RX(p2) ┠─┨ RZ(p5) ┠──────■──────────────────
      ┗━━━━━━━━┛ ┗━━━━━━━━┛