qubiter.adv_applications.StairsAllDeriv_rigetti module

class qubiter.adv_applications.StairsAllDeriv_rigetti.StairsAllDeriv_rigetti(qc, gate_str_to_rads_list, file_prefix, parent_num_qbits, hamil, **kwargs)[source]

Bases: qubiter.adv_applications.StairsDeriv_rigetti.StairsDeriv_rigetti

This class is a child of StairsDeriv_rigetti. For the parent class, the get_mean_val() method returns a list of 4 partial derivatives belonging to a particular gate string (a gate_str is a key in gate_str_to_rads_list). For this class, get_mean_val() returns an ordered dictionary mapping each gate_str to its 4 partials.

Variables:deriv_gate_str (str) –
__init__(qc, gate_str_to_rads_list, file_prefix, parent_num_qbits, hamil, **kwargs)[source]

Constructor

Parameters:
  • qc (QuantumComputer) –
  • gate_str_to_rads_list (dict[str, list[float|str]]) –
  • file_prefix (str) –
  • parent_num_qbits (int) –
  • hamil (QubitOperator) –
  • kwargs (dict) – key-word arguments of MeanHamil
get_mean_val(var_num_to_rads)[source]

This method returns an ordered dictionary gate_str_to_partials_list mapping each gate_str to its 4 partial derivatives. This method calls the get_mean_val() of the parent class for all possible gate_str.

The output dictionary of this method can be converted to a numpy array using StairDerivCkt_writer.make_array_from_gate_str_to_rads_list()

Parameters:var_num_to_rads (dict[int, float]) –
Returns:
Return type:dict[str, list[float]]