mindquantum.algorithm.nisq.Ansatz5

查看源文件
class mindquantum.algorithm.nisq.Ansatz5(n_qubits: int, depth: int, prefix: str = '', suffix: str = '')[源代码]

Arxiv 论文中所提及的量子线路5。

../../_images/ansatz5.png

请参考论文 Expressibility and entangling capability of parameterized quantum circuits for hybrid quantum-classical algorithms.

参数:
  • n_qubits (int) - 量子线路的总比特数。

  • depth (int) - ansatz 的循环层数。

  • prefix (str) - 参数的前缀。默认值: ''

  • suffix (str) - 参数的后缀。默认值: ''

样例:

>>> from mindquantum.algorithm.nisq import Ansatz5
>>> Ansatz5(3, 1).circuit
      ┏━━━━━━━━┓ ┏━━━━━━━━┓            ┏━━━━━━━━┓            ┏━━━━━━━━┓
q0: ──┨ RX(p0) ┠─┨ RZ(p3) ┠────────────┨ RZ(p7) ┠────────────┨ RZ(p9) ┠──────■──────↯─
      ┗━━━━━━━━┛ ┗━━━━━━━━┛            ┗━━━━┳━━━┛            ┗━━━━┳━━━┛      ┃
      ┏━━━━━━━━┓ ┏━━━━━━━━┓ ┏━━━━━━━━┓      ┃                     ┃          ┃
q1: ──┨ RX(p1) ┠─┨ RZ(p4) ┠─┨ RZ(p6) ┠──────╂──────────■──────────■──────────╂──────↯─
      ┗━━━━━━━━┛ ┗━━━━━━━━┛ ┗━━━━┳━━━┛      ┃          ┃                     ┃
      ┏━━━━━━━━┓ ┏━━━━━━━━┓      ┃          ┃     ┏━━━━┻━━━┓            ┏━━━━┻━━━━┓
q2: ──┨ RX(p2) ┠─┨ RZ(p5) ┠──────■──────────■─────┨ RZ(p8) ┠────────────┨ RZ(p10) ┠─↯─
      ┗━━━━━━━━┛ ┗━━━━━━━━┛                       ┗━━━━━━━━┛            ┗━━━━━━━━━┛
                  ┏━━━━━━━━━┓ ┏━━━━━━━━━┓
q0: ───────■──────┨ RX(p12) ┠─┨ RZ(p15) ┠───
           ┃      ┗━━━━━━━━━┛ ┗━━━━━━━━━┛
      ┏━━━━┻━━━━┓ ┏━━━━━━━━━┓ ┏━━━━━━━━━┓
q1: ──┨ RZ(p11) ┠─┨ RX(p13) ┠─┨ RZ(p16) ┠───
      ┗━━━━━━━━━┛ ┗━━━━━━━━━┛ ┗━━━━━━━━━┛
                  ┏━━━━━━━━━┓ ┏━━━━━━━━━┓
q2: ──────────────┨ RX(p14) ┠─┨ RZ(p17) ┠───
                  ┗━━━━━━━━━┛ ┗━━━━━━━━━┛