mindquantum.algorithm.nisq.SGAnsatz
- class mindquantum.algorithm.nisq.SGAnsatz(nqubits, k, nlayers=1, prefix: str = '', suffix: str = '')[source]
SG ansatz for 1D quantum systems.
The SG ansatz consists of multiple variational quantum circuit blocks, each of which is a parametrized quantum circuit applied to several adjacent qubits. With such a structure, the SG ansatz naturally adapts to quantum many-body problems.
Specifically, for 1D quantum systems, the SG ansatz can efficiently generate any matrix product states with a fixed bond dimension. For 2D systems, the SG ansatz can generate string-bond states.
For more detail, please refers A sequentially generated variational quantum circuit with polynomial complexity.
- Parameters
Examples
>>> from mindquantum.core.algorithm import SGAnsatz >>> sg = SGAnsatz(4, 2, 1) >>> sg.circuit ┏━━━━━━━━━━━┓ ┏━━━━━━━━━━━━┓ q0: ──┨ RX(a1_00) ┠─┨ RZ(b1_000) ┠────────■───────────────────────────────────────────────────────────────────── ┗━━━━━━━━━━━┛ ┗━━━━━━━━━━━━┛ ┃ ┏━━━━━━━━━━━━┓ ┏━━━━━━┻━━━━━┓ ┏━━━━━━━━━━━━┓ q1: ──┨ RY(b1_001) ┠───────────────┨ RX(b2_000) ┠─┨ RY(b1_101) ┠────────■─────────────────────────────────────── ┗━━━━━━━━━━━━┛ ┗━━━━━━━━━━━━┛ ┗━━━━━━━━━━━━┛ ┃ ┏━━━━━━━━━━━━┓ ┏━━━━━━┻━━━━━┓ ┏━━━━━━━━━━━━┓ q2: ──┨ RY(b1_102) ┠─────────────────────────────────────────────┨ RX(b2_101) ┠─┨ RX(b1_202) ┠────────■───────── ┗━━━━━━━━━━━━┛ ┗━━━━━━━━━━━━┛ ┗━━━━━━━━━━━━┛ ┃ ┏━━━━━━━━━━━━┓ ┏━━━━━━┻━━━━━┓ q3: ──┨ RY(b1_203) ┠───────────────────────────────────────────────────────────────────────────┨ RZ(b2_202) ┠─── ┗━━━━━━━━━━━━┛ ┗━━━━━━━━━━━━┛