openqemist.quantum_solvers.rigetti package¶

openqemist.quantum_solvers.rigetti.rigetti_parametric_solver module¶

Perform quantum simulation using Rigetti’s stack, using packages such as pyquil and forestopenfermion.

class openqemist.quantum_solvers.rigetti.rigetti_parametric_solver.RigettiParametricSolver(ansatz, molecule, mean_field=None, backend_options={'backend': 'wavefunction_simulator'})[source]

Performs an energy estimation for a molecule with a parametric circuit.

Performs energy estimations for a given molecule and a choice of ansatz circuit that is supported.

Uses the CCSD method to solve the electronic structure problem. PySCF program will be utilized. Users can also provide a function that takes a pyscf.gto.Mole as its first argument and pyscf.scf.RHF as its second.

optimized_amplitudes

The optimized UCCSD amplitudes.

Type

list

of_mole

Molecular Data in Openfermion.

Type

openfermion.hamiltonian.MolecularData

f_hamiltonian

Fermionic Hamiltonian.

Type

openfermion.ops.InteractionOperator

qubit_hamiltonian

Qubit Hamiltonian.

Type

openfermion.transforms.jordan_wigner

n_qubits

Number of qubits.

Type

int

class Ansatze[source]

Bases: enum.Enum

Enumeration of the ansatz circuits that are supported.

UCCSD = 0
default_initial_var_parameters()[source]

Returns initial variational parameters for a VQE simulation.

Returns initial variational parameters for the circuit that is generated for a given ansatz.

Returns

Initial parameters.

Return type

list

get_rdm()[source]

Obtain the RDMs from the optimized amplitudes.

Obtain the RDMs from the optimized amplitudes by using the same function for energy evaluation. The RDMs are computed by using each fermionic Hamiltonian term, transforming them and computing the elements one-by-one. Note that the Hamiltonian coefficients will not be multiplied as in the energy evaluation. The first element of the Hamiltonian is the nuclear repulsion energy term, not the Hamiltonian term.

Returns

One & two-particle RDMs (rdm1_np & rdm2_np, float64).

Return type

(numpy.array, numpy.array)

Raises

RuntimeError – If no simulation has been run.

simulate(amplitudes)[source]

Perform the simulation for the molecule.

Parameters

amplitudes (list) – The initial amplitudes (float64).

Returns

The total energy (energy).

Return type

float64

Raise:

ValueError: If the dimension of the amplitude list is incorrect.