PH.ph_step_exe

vqe_step

For executing a VQE quantum step of a ansatz and a given Parent Hamiltonian. Author: Gonzalo Ferro

class tnbs.BTC_04_PH.PH.ph_step_exe.vqe_step.PH_EXE(ansatz, pauli_ph, nqubits, **kwargs)

Bases: object

Class for, given an ansatz and its parent hamiltonian Pauli decompostion, execute a VQE step

Parameters:
  • ansatz (QLM circuit) – QLM circuit with the input ansatz

  • n_qubits (int) – number of qubits of the ansatz

  • pauli_ph (pandas DataFrame) – pauli decomposition of the parent Hamiltonian

  • kwars (dictionary) – For configuring the class

run()

Execute VQE step

save()

Saving Staff

tnbs.BTC_04_PH.PH.ph_step_exe.vqe_step.get_info_basefn(base_fn)
tnbs.BTC_04_PH.PH.ph_step_exe.vqe_step.run_ph_execution(**configuration)

Given an ansatz circuit, the parameters and the Pauli decomposition of the corresponding local PH executes a VQE step for computing the energy of the ansatz under the Hamiltonian that MUST BE near 0

Note

Given an input base_fn that MUST have following pattern:

  • base_fn = ansatz_{}_nqubits_{}_depth_{}_qpu_ansatz_{}

Additionally folowing files MUST exist:

  • {base_fn}_parameters.csv

  • {base_fn}_pauli.csv

The functions gets the information about: ansatz, nqubits and depth and executes the following Workflow:

  1. Create QLM circuit using the ansatz type readed from the folder

  2. Loading parameters for the circuit from: {}_parameters.csv

  3. Loading Pauli Decomposition from: {}_pauli.csv

  4. Executes VQE step.

If save is True the result of the execution is stored as:

  • {base_fn}_phexe.csv

launch_vqe_step

For launching a VQE quantum step execution Author: Gonzalo Ferro

tnbs.BTC_04_PH.PH.ph_step_exe.launch_vqe_step.run_id(**configuration)