Skip to main contentIBM Quantum Documentation
This page is from an old version of Qiskit SDK and does not exist in the latest version. We recommend you migrate to the latest version. See the release notes for more information.

qiskit.aqua.components.variational_forms.VariationalForm

class VariationalForm

GitHub

Base class for VariationalForms.

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

__init__

abstract __init__()

Initialize self. See help(type(self)) for accurate signature.


Methods

__init__()Initialize self.
construct_circuit(parameters[, q])Construct the variational form, given its parameters.
get_entangler_map(map_type, num_qubits[, offset])returns entangler map
validate_entangler_map(entangler_map, num_qubits)validate entangler map

Attributes

num_parametersNumber of parameters of the variational form.
num_qubitsNumber of qubits of the variational form.
parameter_boundsParameter bounds.
preferred_init_pointsReturn preferred init points.
setting
support_parameterized_circuitWhether or not the sub-class support parameterized circuit.

construct_circuit

abstract 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 get_entangler_map(map_type, num_qubits, offset=0)

returns entangler map

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

validate_entangler_map

static validate_entangler_map(entangler_map, num_qubits)

validate entangler map

Was this page helpful?
Report a bug or request content on GitHub.