qubiter.adv_applications.StairsDeriv_rigetti module¶
-
class
qubiter.adv_applications.StairsDeriv_rigetti.
StairsDeriv_rigetti
(qc, deriv_gate_str, gate_str_to_rads_list, file_prefix, parent_num_qbits, hamil, **kwargs)[source]¶ Bases:
qubiter.adv_applications.StairsDeriv.StairsDeriv
This class is a child of StairsDeriv. Its main purpose is to override the method get_mean_val() of its abstract parent class StairsDeriv. In this class, the simulation necessary to evaluate the output of get_mean_val() is done by Rigetti Pyquil simulators or their physical qc device.
Variables: - qc (QuantumComputer) – returned by PyQuil method get_qc()
- translation_line_list (list[str]) – a list of lines of PyQuil code generated by the translator. The lines all start with “pg +=”.
- translator (Qubiter_to_RigettiPyQuil) –
-
__init__
(qc, deriv_gate_str, gate_str_to_rads_list, file_prefix, parent_num_qbits, hamil, **kwargs)[source]¶ Constructor
Parameters: - qc (QuantumComputer) –
- 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
-
get_mean_val
(var_num_to_rads)[source]¶ This method returns a list partials_list consisting of 4 floats which are the partial derivatives wrt the 4 possible derivative directions ( deriv_direc), of the multi-controlled gate U specified by self.deriv_gate_str.
Parameters: var_num_to_rads (dict[int, float]) – Returns: Return type: list[float]