mindquantum.algorithm.nisq.Ansatz7

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

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

../../_images/ansatz7.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 Ansatz7
>>> Ansatz7(4, 1).circuit
      ┏━━━━━━━━┓ ┏━━━━━━━━┓ ┏━━━━━━━━┓ ┏━━━━━━━━━┓ ┏━━━━━━━━━┓
q0: ──┨ RX(p0) ┠─┨ RZ(p4) ┠─┨ RZ(p8) ┠─┨ RX(p10) ┠─┨ RZ(p14) ┠───────────────
      ┗━━━━━━━━┛ ┗━━━━━━━━┛ ┗━━━━┳━━━┛ ┗━━━━━━━━━┛ ┗━━━━━━━━━┛
      ┏━━━━━━━━┓ ┏━━━━━━━━┓      ┃     ┏━━━━━━━━━┓ ┏━━━━━━━━━┓ ┏━━━━━━━━━┓
q1: ──┨ RX(p1) ┠─┨ RZ(p5) ┠──────■─────┨ RX(p11) ┠─┨ RZ(p15) ┠─┨ RZ(p18) ┠───
      ┗━━━━━━━━┛ ┗━━━━━━━━┛            ┗━━━━━━━━━┛ ┗━━━━━━━━━┛ ┗━━━━┳━━━━┛
      ┏━━━━━━━━┓ ┏━━━━━━━━┓ ┏━━━━━━━━┓ ┏━━━━━━━━━┓ ┏━━━━━━━━━┓      ┃
q2: ──┨ RX(p2) ┠─┨ RZ(p6) ┠─┨ RZ(p9) ┠─┨ RX(p12) ┠─┨ RZ(p16) ┠──────■────────
      ┗━━━━━━━━┛ ┗━━━━━━━━┛ ┗━━━━┳━━━┛ ┗━━━━━━━━━┛ ┗━━━━━━━━━┛
      ┏━━━━━━━━┓ ┏━━━━━━━━┓      ┃     ┏━━━━━━━━━┓ ┏━━━━━━━━━┓
q3: ──┨ RX(p3) ┠─┨ RZ(p7) ┠──────■─────┨ RX(p13) ┠─┨ RZ(p17) ┠───────────────
      ┗━━━━━━━━┛ ┗━━━━━━━━┛            ┗━━━━━━━━━┛ ┗━━━━━━━━━┛