Skip to main contentIBM Quantum Documentation
You are viewing the API reference for an old version of Qiskit SDK. Switch to latest version

VariationalForm

VariationalForm GitHub(opens in a new tab)

Base class for VariationalForms.

This method should initialize the module and use an exception if a component of the module is not available.


Attributes

num_parameters

Number of parameters of the variational form.

Returns

An integer indicating the number of parameters.

Return type

int

num_qubits

Number of qubits of the variational form.

Returns

An integer indicating the number of qubits.

Return type

int

parameter_bounds

Parameter bounds.

Returns

A list of pairs indicating the bounds, as (lower, upper). None indicates an unbounded parameter in the corresponding direction. If None is returned, problem is fully unbounded.

Return type

list

preferred_init_points

Return preferred init points.

If an initial state is provided then the variational form may provide back this set of parameters which when used on the variational form should result in the overall state being that defined by the initial state

setting

support_parameterized_circuit

Whether or not the sub-class support parameterized circuit.

Returns

indicate the sub-class support parameterized circuit

Return type

boolean


Methods

construct_circuit

abstract VariationalForm.construct_circuit(parameters, q=None)

Construct the variational form, given its parameters.

Parameters

  • parameters (Union[List[float], ndarray]) – circuit parameters.
  • q (Optional[QuantumRegister]) – Quantum Register for the circuit.

Returns

A quantum circuit.

Return type

QuantumCircuit

get_entangler_map

static VariationalForm.get_entangler_map(map_type, num_qubits, offset=0)

returns entangler map

validate_entangler_map

static VariationalForm.validate_entangler_map(entangler_map, num_qubits)

validate entangler map

Was this page helpful?