About cookies on this site Our websites require some cookies to function properly (required). In addition, other cookies may be used with your consent to analyze site usage, improve the user experience and for advertising. For more information, please review your options. By visiting our website, you agree to our processing of information as described in IBM’sprivacy statement. To provide a smooth navigation, your cookie preferences will be shared across the IBM web domains listed here.
DefaultCNOTUnitObjective
class DefaultCNOTUnitObjective(num_qubits, cnots)
Bases: qiskit.transpiler.synthesis.aqc.cnot_unit_objective.CNOTUnitObjective
A naive implementation of the objective function based on CNOT units.
Parameters
- num_qubits (
int
) – number of qubits. - cnots (
ndarray
) – a CNOT structure to be used in the optimization procedure.
Methods Defined Here
gradient
DefaultCNOTUnitObjective.gradient(param_values)
Computes a gradient with respect to parameters given a vector of parameter values.
Parameters
param_values (ndarray
) – a vector of parameter values for the optimization problem.
Return type
ndarray
Returns
an array of gradient values.
objective
DefaultCNOTUnitObjective.objective(param_values)
Computes a value of the objective function given a vector of parameter values.
Parameters
param_values (ndarray
) – a vector of parameter values for the optimization problem.
Return type
float
Returns
a float value of the objective function.
Attributes
num_cnots
Returns: A number of CNOT units to be used by the approximate circuit.
num_thetas
Returns: Number of parameters (angles) of rotation gates in this circuit.
target_matrix
Returns: a matrix being approximated
Return type
ndarray
Was this page helpful?
Report a bug or request content on GitHub.