DefaultCNOTUnitObjective#

class qiskit.transpiler.synthesis.aqc.DefaultCNOTUnitObjective(num_qubits, cnots)[source]#

Bases: CNOTUnitObjective

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

প্যারামিটার:
  • num_qubits (int) -- 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(param_values)[source]#

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

প্যারামিটার:

param_values (ndarray) -- a vector of parameter values for the optimization problem.

রিটার্নস:

an array of gradient values.

রিটার্ন টাইপ:

ndarray

objective(param_values)[source]#

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

প্যারামিটার:

param_values (ndarray) -- a vector of parameter values for the optimization problem.

রিটার্নস:

a float value of the objective function.

রিটার্ন টাইপ:

SupportsFloat