Skip to main contentIBM Quantum Documentation

DefaultCNOTUnitObjective

qiskit.synthesis.unitary.aqc.DefaultCNOTUnitObjective(num_qubits, cnots)GitHub(opens in a new tab)

Bases: CNOTUnitObjective

A naive implementation of the objective function based on CNOT units.

Parameters

  • num_qubits (int(opens in a new tab)) – number of qubits.
  • cnots (np.ndarray) – a CNOT structure to be used in the optimization procedure.

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


Methods

gradient

gradient(param_values)

Computes a gradient with respect to parameters given a vector of parameter values.

Parameters

param_values (ndarray(opens in a new tab)) – a vector of parameter values for the optimization problem.

Returns

an array of gradient values.

Return type

ndarray(opens in a new tab)

objective

objective(param_values)

Computes a value of the objective function given a vector of parameter values.

Parameters

param_values (ndarray(opens in a new tab)) – a vector of parameter values for the optimization problem.

Returns

a float value of the objective function.

Return type

SupportsFloat(opens in a new tab)

Was this page helpful?