mindquantum.algorithm.nisq.uccsd0_singlet_generator
- mindquantum.algorithm.nisq.uccsd0_singlet_generator(n_qubits=None, n_electrons=None, anti_hermitian=True, occ_orb=None, vir_orb=None, generalized=False)[source]
Generate UCCSD operators using CCD0 ansatz for molecular systems.
Note
Manually assigned occ_orb or vir_orb are indices of spatial orbitals instead of spin-orbitals. They will override n_electrons and n_qubits. This is to some degree similar to the active space, therefore can reduce the number of variational parameters. However, it may not reduce the number of required qubits, since Fermion excitation operators are non-local, i.e., \(a_{7}^{\dagger} a_{0}\) involves not only the 0th and 7th qubit, but also the 1st, 2nd, … 6th qubit.
- Parameters
n_qubits (int) – Number of qubits (spin-orbitals). Default:
None
.n_electrons (int) – Number of electrons (occupied spin-orbitals). Default:
None
.anti_hermitian (bool) – Whether to subtract the hermitian conjugate to form anti-Hermitian operators. Default:
True
.occ_orb (list) – Indices of manually assigned occupied spatial orbitals. Default:
None
.vir_orb (list) – Indices of manually assigned virtual spatial orbitals. Default:
None
.generalized (bool) – Whether to use generalized excitations which do not distinguish occupied or virtual orbitals (UCCGSD). Default:
False
.
- Returns
FermionOperator, Generator of the UCCSD operators that uses CCD0 ansatz.
Examples
>>> from mindquantum.algorithm.nisq import uccsd0_singlet_generator >>> uccsd0_singlet_generator(4, 2) -1.0*d0_s_0 [0^ 2] + 2.0*d0_d_0 [1^ 0^ 3 2] + -1.0*d0_s_0 [1^ 3] + 1.0*d0_s_0 [2^ 0] + 1.0*d0_s_0 [3^ 1] + -2.0*d0_d_0 [3^ 2^ 1 0] >>> uccsd0_singlet_generator(4, 2, generalized=True) 1.0*d0_s_0 - 1.0*d0_s_1 [0^ 2] + 1.0*d0_d_0 [1^ 0^ 2 1] + -1.0*d0_d_0 [1^ 0^ 3 0] + -2.0*d0_d_1 [1^ 0^ 3 2] + 1.0*d0_s_0 - 1.0*d0_s_1 [1^ 3] + -1.0*d0_s_0 + 1.0*d0_s_1 [2^ 0] + -1.0*d0_d_0 [2^ 1^ 1 0] + 1.0*d0_d_2 [2^ 1^ 3 2] + 1.0*d0_d_0 [3^ 0^ 1 0] + -1.0*d0_d_2 [3^ 0^ 3 2] + -1.0*d0_s_0 + 1.0*d0_s_1 [3^ 1] + 2.0*d0_d_1 [3^ 2^ 1 0] + -1.0*d0_d_2 [3^ 2^ 2 1] + 1.0*d0_d_2 [3^ 2^ 3 0] >>> uccsd0_singlet_generator(6, 2, occ_orb=[0], vir_orb=[1]) -1.0*d0_s_0 [0^ 2] + 2.0*d0_d_0 [1^ 0^ 3 2] + -1.0*d0_s_0 [1^ 3] + 1.0*d0_s_0 [2^ 0] + 1.0*d0_s_0 [3^ 1] + -2.0*d0_d_0 [3^ 2^ 1 0]