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.

FirstOrderExpansion

class FirstOrderExpansion(feature_dimension, depth=2, data_map_func=<function self_product>)

GitHub

DEPRECATED. First Order Expansion feature map.

This is a sub-class of PauliZExpansion where z_order is fixed at 1. As a result the first order expansion will be a feature map without entangling gates.

Parameters

  • feature_dimension (int) – The number of features
  • depth (int) – The number of repeated circuits. Defaults to 2, has a minimum value of 1.
  • data_map_func (Callable[[ndarray], float]) – A mapping function for data x which can be supplied to override the default mapping from self_product().

Attributes

feature_dimension

returns feature dimension

num_qubits

returns number of qubits

support_parameterized_circuit

returns whether or not the sub-class support parameterized circuit


Methods

construct_circuit

FirstOrderExpansion.construct_circuit(x, qr=None, inverse=False)

Construct the second order expansion based on given data.

Parameters

  • x (Union(numpy.ndarray, list[Parameter], ParameterVector)) – 1-D to-be-transformed data.
  • qr (QuantumRegister, optional) – the QuantumRegister object for the circuit, if None, generate new registers with name q.
  • inverse (bool, optional) – whether or not inverse the circuit

Returns

a quantum circuit transform data x.

Return type

QuantumCircuit

Raises

  • TypeError – invalid input
  • ValueError – invalid input

get_entangler_map

static FirstOrderExpansion.get_entangler_map(map_type, num_qubits)

get entangle map

validate_entangler_map

static FirstOrderExpansion.validate_entangler_map(entangler_map, num_qubits)

validate entangler map

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