class documentation
class ParameterizedUnitaryGate(Gate): (source)
Constructor: ParameterizedUnitaryGate(op_func, params, num_qubits, cutoffs, ...)
UnitaryGate sublcass that stores the operator matrix for later reference by animation utility.
| Method | __array__ |
Call the operator function to build the array using the bound parameter values. |
| Method | __init__ |
Initialize ParameterizedUnitaryGate |
| Method | calculate |
Calculate the operator matrix by executing the selected function. Increment the parameters based upon the current and total steps. |
| Method | validate |
Gate parameters should be int, float, complex, or ParameterExpression |
| Instance Variable | cutoffs |
Undocumented |
| Instance Variable | definition |
Undocumented |
| Instance Variable | discretized |
Undocumented |
| Instance Variable | duration |
Undocumented |
| Instance Variable | op |
Undocumented |
| Instance Variable | unit |
Undocumented |
| Method | _define |
Undocumented |
| Instance Variable | _parameterized |
Undocumented |
def __init__(self, op_func:
UnitaryFunc, params: Any, num_qubits: int, cutoffs: Sequence[ int], label: str | None = None, duration: int = 100, unit: str = 'ns', discretized_param_indices: list | None = None):
(source)
¶
Initialize ParameterizedUnitaryGate
| Parameters | |
opfunction | function to build operator matrix |
params:List | List of parameters to pass to op_func to build operator matrix (supports instances of Qiskit Parameter to be bound later) |
numint | Number of qubits in the operator -- this would likely equate to (num_qubits_per_qumode * num_qumodes + num_ancilla). |
cutoffs:Sequence[ | Undocumented |
label:string, optional | Gate name. Defaults to None. |
duration:int, optional | Duration of gate used for noise modeling. Defaults to 100. |
unit:string, optional | Unit of duration (only supports those allowed by Qiskit). |
discretizedlist | list of int indices into self.params for parameters to be discretized. An empty list will discretize all params. |
def calculate_matrix(self, current_step:
int = 1, total_steps: int = 1, keep_state: bool = False):
(source)
¶
Calculate the operator matrix by executing the selected function. Increment the parameters based upon the current and total steps.
| Parameters | |
currentint, optional | Current step within total_steps. Defaults to 1. |
totalint, optional | Total steps to increment parameters. Defaults to 1. |
keepbool | Undocumented |
| Returns | |
ndarray | operator matrix |