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.

PauliExpansion

class PauliExpansion(feature_dimension, depth=2, entangler_map=None, entanglement='full', paulis=None, data_map_func=<function self_product>)

GitHub

DEPRECATED. The Pauli Expansion feature map.

Refer to https://arxiv.org/abs/1804.11326 for details.

The Pauli Expansion feature map transforms data xRn\vec{x} \in \mathbb{R}^n according to the following equation, and then duplicate the same circuit with depth dd times, where dd is the depth of the circuit:

UΦ(x)=exp(iS[n]ϕS(x)iSPi)U_{\Phi(\vec{x})}=\exp\left(i\sum_{S\subseteq [n]} \phi_S(\vec{x})\prod_{i\in S} P_i\right)

where S{(nk) combinations, k=1,...n},ϕS(x)=xiS \in \{\binom{n}{k}\ combinations,\ k = 1,... n \}, \phi_S(\vec{x}) = x_i if k=1k=1, otherwise ϕS(x)=S(πxj)\phi_S(\vec{x}) = \prod_S(\pi - x_j), where jSj \in S, and Pi{I,X,Y,Z}P_i \in \{ I, X, Y, Z \}

Please refer to FirstOrderExpansion for the case k=1k = 1, P0=ZP_0 = Z and to SecondOrderExpansion for the case k=2k = 2, P0=Z and P1P0=ZZP_0 = Z\ and\ P_1 P_0 = ZZ.

Parameters

  • feature_dimension (int) – The number of features
  • depth (int) – The number of repeated circuits. Defaults to 2, has a minimum value of 1.
  • entangler_map (Optional[List[List[int]]]) – Describes the connectivity of qubits, each list in the overall list describes [source, target]. Defaults to None where the map is created as per entanglement parameter. Note that the order in the list is the order of applying the two-qubit gate.
  • entanglement (str) – (‘full’ | ‘linear’), generate the qubit connectivity by a predefined topology. Defaults to full which connects every qubit to each other. Linear connects each qubit to the next.
  • paulis (Optional[List[str]]) – a list of strings for to-be-used paulis (a pauli is a any combination of I, X, Y ,Z). Note that the order of pauli label is counted from right to left as the notation used in Pauli class in Qiskit Terra. Defaults to None whereupon [‘Z’, ‘ZZ’] will be used.
  • 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

PauliExpansion.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 PauliExpansion.get_entangler_map(map_type, num_qubits)

get entangle map

validate_entangler_map

static PauliExpansion.validate_entangler_map(entangler_map, num_qubits)

validate entangler map

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