pyriemann_qiskit.optimization.docplex.QAOACVAngleOptimizer

class pyriemann_qiskit.optimization.docplex.QAOACVAngleOptimizer(create_mixer=None, n_reps=3, quantum_instance=None, optimizer=None)[source]

QAOA with continuous variables encoded in state vector angles.

This optimizer encodes continuous variables directly in the angles/phases of the quantum state vector, rather than converting them to binary variables and using probability distributions.

Parameters:
  • create_mixer (Callable[int, QuantumCircuit], default=create_mixer_rotational_X_gates(0)) – A delegate that takes into input an angle and returns a QuantumCircuit.

  • n_reps (int, default=3) – The number of repetitions for the QAOA ansatz. It defines how many time Mixer and Cost operators will be repeated in the circuit.

  • quantum_instance (QuantumInstance, default=None) – A quantum backend instance. If None, AerSimulator will be used.

  • optimizer (SciPyOptimizer, default=L_BFGS_B(maxiter=100, maxfun=200)) – An instance of a scipy optimizer to find the optimal weights for the parametric circuit (ansatz).

Notes

Added in version 0.5.0.

x_

Indices of the loss function.

Type:

list[int]

y_

Cost computed by the loss function.

Type:

list[int]

run_time_

Time taken by the optimizer

Type:

float

optim_params_

The optimal rotation for the gate in the circuit.

Type:

list[float]

minimum_

The value of the objective function with the optimal parameters.

Type:

float

state_vector_

State vector of the optimized quantum circuit (optimal parameters assigned to the parametric gates).

Type:

StateVector

variable_bounds_

The bounds for each continuous variable.

Type:

list[tuple]

See also

pyQiskitOptimizer, QAOACVOptimizer, create_mixer_rotational_X_gates

__init__(create_mixer=None, n_reps=3, quantum_instance=None, optimizer=None)[source]

Methods

__init__([create_mixer, n_reps, ...])

convert_spdmat(X)

Convert a SPD matrix

get_weights(prob, classes)

Get weights variable

prepare_model(qp)

Prepare model by storing variable bounds.

solve(prob[, reshape])

Solve the docplex problem.

spdmat_var(prob, channels, name)

Create docplex matrix variable