diff --git a/c2qa/operators.py b/c2qa/operators.py index 6899317..de4fa07 100644 --- a/c2qa/operators.py +++ b/c2qa/operators.py @@ -429,8 +429,10 @@ def c_multiboson_sampling(self, max): def gate_from_matrix(self, matrix): """Converts matrix into gate. Called using ParameterizedUnitaryGate. + Args: matrix (list): the (unitary) matrix that you wish to convert into a gate + Returns: csc_matrix: operator matrix """ diff --git a/c2qa/parameterized_unitary_gate.py b/c2qa/parameterized_unitary_gate.py index ce8e1b6..af64d39 100644 --- a/c2qa/parameterized_unitary_gate.py +++ b/c2qa/parameterized_unitary_gate.py @@ -18,11 +18,8 @@ def __init__( Args: op_func (function): 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) - num_qubits (int): Number of qubits in the operator -- this would - likely equate to (num_qubits_per_qumode * num_qumodes + num_ancilla). + params (List): List of parameters to pass to op_func to build operator matrix (supports instances of Qiskit Parameter to be bound later) + num_qubits (int): Number of qubits in the operator -- this would likely equate to (num_qubits_per_qumode * num_qumodes + num_ancilla). 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). @@ -94,9 +91,11 @@ def calculate_matrix( ): """Calculate the operator matrix by executing the selected function. Increment the parameters based upon the current and total steps. + Args: current_step (int, optional): Current step within total_steps. Defaults to 1. total_steps (int, optional): Total steps to increment parameters. Defaults to 1. + Returns: ndarray: operator matrix """