mindquantum.algorithm.nisq.StronglyEntangling

View Source On Gitee
class mindquantum.algorithm.nisq.StronglyEntangling(n_qubits: int, depth: int, entangle_gate: BasicGate, prefix: str = '', suffix: str = '')[source]

Strongly entangling ansatz.

Please refers Circuit-centric quantum classifiers.

Parameters
  • n_qubits (int) – number of qubit that this ansatz act on.

  • depth (int) – the depth of ansatz.

  • entangle_gate (BasicGate) – a quantum gate to generate entanglement. If a single qubit gate is given, a control qubit will add, if a two qubits gate is given, the two qubits gate will act on different qubits.

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

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

Examples

>>> from mindquantum.core.gates import X
>>> from mindquantum.algorithm.nisq import StronglyEntangling
>>> ansatz = StronglyEntangling(3, 2, X)
>>> ansatz.circuit
      ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓             ┏━━━┓
q0: ──┨ U3(θ=l0_a0, φ=l0_b0, λ=l0_c0) ┠───■─────────┨╺╋╸┠─↯─
      ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛   ┃         ┗━┳━┛
      ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓ ┏━┻━┓         ┃
q1: ──┨ U3(θ=l0_a1, φ=l0_b1, λ=l0_c1) ┠─┨╺╋╸┠───■─────╂───↯─
      ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛ ┗━━━┛   ┃     ┃
      ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓       ┏━┻━┓   ┃
q2: ──┨ U3(θ=l0_a2, φ=l0_b2, λ=l0_c2) ┠───────┨╺╋╸┠───■───↯─
      ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛       ┗━━━┛
      ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓       ┏━━━┓
q0: ──┨ U3(θ=l1_a0, φ=l1_b0, λ=l1_c0) ┠───■───┨╺╋╸┠─────────
      ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛   ┃   ┗━┳━┛
      ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓   ┃     ┃   ┏━━━┓
q1: ──┨ U3(θ=l1_a1, φ=l1_b1, λ=l1_c1) ┠───╂─────■───┨╺╋╸┠───
      ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛   ┃         ┗━┳━┛
      ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓ ┏━┻━┓         ┃
q2: ──┨ U3(θ=l1_a2, φ=l1_b2, λ=l1_c2) ┠─┨╺╋╸┠─────────■─────
      ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛ ┗━━━┛