quri_parts.openfermion.ansatz package#

class quri_parts.openfermion.ansatz.KUpCCGSD(n_spin_orbitals: int, n_fermions: int, k: int = 1, fermion_qubit_mapping: ~quri_parts.openfermion.transforms.OpenFermionQubitMapping = <quri_parts.openfermion.transforms.OpenFermionJordanWigner object>, trotter_number: int = 1, delta_sz: int = 0, singlet_excitation: bool = False)#

Bases: ImmutableLinearMappedUnboundParametricQuantumCircuit

k-unitary pair coupled-cluster generalized singles and doubles (k-UpCCGSD) ansatz. The ansatz consists of the exponentials of generalized single excitation and pair double excitation operators decomposed by first- order Trotter product formula repeated k times. The term “generalized” means excitation operators created regardless of the occupied orbitals. Here the double excitations are limited to ‘pair’ excitation, which means two electrons from one spatial orbital to another.

Ref:

Lee et al., Generalized Unitary Coupled Cluster Wave functions for Quantum Computation, J. Chem. Theory Comput. 15, 311–324 (2019), arXiv:1810.02327.

PennyLane’s documentations, qml.kUpCCGSD

Parameters:
  • n_spin_orbitals – Number of spin orbitals.

  • n_fermions – Number of fermions.

  • k – Number of repetitions.

  • fermion_qubit_mapping – Mapping from FermionOperator to Operator

  • trotter_number – Number for first-order Trotter product formula.

  • delta_sz – Changes of spin in the excitation.

  • singlet_excitation – If True, single excitations that start from and end at the same spatial orbitals will share the same circuit parameter. For the double excitations, the excitations are paired, so the singlet excitation condition is satisfied automatically.

class quri_parts.openfermion.ansatz.TrotterUCCSD(n_spin_orbitals: int, n_fermions: int, fermion_qubit_mapping: ~quri_parts.openfermion.transforms.OpenFermionQubitMapping = <quri_parts.openfermion.transforms.OpenFermionJordanWigner object>, trotter_number: int = 1, use_singles: bool = True, delta_sz: int = 0, singlet_excitation: bool = False)#

Bases: ImmutableLinearMappedUnboundParametricQuantumCircuit

Unitary coupled-cluster singles and doubles (UCCSD) ansatz. The ansatz consists of the exponentials of single excitation and double excitation operator decomposed by first-order Trotter product formula. Note that the ansatz only supports singlet state and the occupied orbitals are the lowest n_fermions spin orbitals. The decomposition using Trotter product formula is executed for each qubit operators obtained by mapping excitation operators.

Parameters:
  • n_spin_orbitals – Number of spin orbitals.

  • n_fermions – Number of fermions.

  • fermion_qubit_mapping – Mapping from FermionOperator to Operator

  • trotter_number – Number for first-order Trotter product formula.

  • use_singles – If True, single-excitation gates are applied.

  • delta_sz – The spin difference of the molecule before and after the transition.

  • singlet_excitation

    If True, the ansatz will be spin symmetric. Parameters for the spin symmetric ansatz are named according to the spatial transition amplitude.

    • For single excitations, parameter named s_i_a denotes the excitation

      from occupied spatial orbital i to virtual spatial orbital a.

    • For double excitations, parameter named d_i_j_a_b denotes the excitation

      from occupied spin orbital (i, ↑), (j, ↓) to virtual spin orbitals (a, ↑), (b, ↓).

Note

Singlets excitation ansatz:

  1. Certain excitation operators will share the same circuit parameters.
    • For single excitation:

      \(c_{a↑}^† c_{i↑}\) and \(c_{a↓}^† c_{i↓}\) share the same transition amplitude \(t_i^a\), thus sharing the same circuit parameter s_i_a.

    • For mixed spin double excitation:
      • \(c_{a↑}^† c_{b↓}^† c_{j↓} c_{i↑}\) and \(c_{a↓}^† c_{b↑}^† c_{j↑} c_{i↓}\) share the same excitaion amplitude \(t_{i↑, j↓}^{a↑, b↓}\), thus sharing the same circuit parameter d_i_j_a_b.

      • All the circuit parameters for double excitation are fixed by

      the mixed spin double excitation mode.

    • For same spin double excitation:

      \(c_{a↑}^† c_{b↑}^† c_{j↑} c_{i↑}\) and \(c_{a↓}^† c_{b↓}^† c_{j↓} c_{i↓}\) share the same excitation amplitude \(t_{i↑, j↓}^{a↑, b↓} - t_{i↓, j↑}^{a↑, b↓}\), where the corresponding parameters d_i_j_a_b and d_i_j_b_a are already added to the circuit when constructing the mixed spin excitation modes.

  2. Parameter count:

    For a system with \(n_o\) occupied spatial orbitals and \(n_v\) virtual spatial orbitals:

    • Single excitations amount for \(n_o n_v\) parameters.

    • Double excitations amount for \(n_o n_v (n_o n_v + 1)/2\) parameters.

Submodules#