qubiter.adv_applications.StairsDeriv module

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

Bases: qubiter.adv_applications.MeanHamil.MeanHamil

This abstract class is a child of abstract class MeanHamil. The main purpose of its children classes is to override the method get_mean_val() of its parent class MeanHamil. The override returns the partial derivatives of a quantum cost function defined from a stairs circuit (an object of of class StairsCkt.writer) and a hamil (an object of the Openfermion class QubitOperator).

Variables:
  • dpart_dict (dict[int, list[str]]) –
  • deriv_gate_str (str) –
  • gate_str_to_rads_list (dict[str, list[float|str]]) –
__init__(deriv_gate_str, gate_str_to_rads_list, file_prefix, parent_num_qbits, hamil, **kwargs)[source]

Constructor

Parameters:
  • deriv_gate_str (str) –
  • 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
dpart_dict = {0: ['single'], 1: ['1', 's', '1s'], 2: ['1', 's', '1s'], 3: ['1', 's', '1s']}
get_mean_val(var_num_to_rads)[source]

Abstract method. The main goal of subclasses of this class is to override this method.

Parameters:var_num_to_rads (dict[int, float]) –