PauliExpansion¶
- class PauliExpansion(feature_dimension, depth=2, entangler_map=None, entanglement='full', paulis=None, data_map_func=<function self_product>)[source]¶
DEPRECATED. The Pauli Expansion feature map.
Refer to https://arxiv.org/abs/1804.11326 for details.
The Pauli Expansion feature map transforms data \(\vec{x} \in \mathbb{R}^n\) according to the following equation, and then duplicate the same circuit with depth \(d\) times, where \(d\) is the depth of the circuit:
\(U_{\Phi(\vec{x})}=\exp\left(i\sum_{S\subseteq [n]} \phi_S(\vec{x})\prod_{i\in S} P_i\right)\)
where \(S \in \{\binom{n}{k}\ combinations,\ k = 1,... n \}, \phi_S(\vec{x}) = x_i\) if \(k=1\), otherwise \(\phi_S(\vec{x}) = \prod_S(\pi - x_j)\), where \(j \in S\), and \(P_i \in \{ I, X, Y, Z \}\)
Please refer to
FirstOrderExpansion
for the case \(k = 1\), \(P_0 = Z\) and toSecondOrderExpansion
for the case \(k = 2\), \(P_0 = Z\ and\ P_1 P_0 = ZZ\).- Parameters
feature_dimension (
int
) – The number of featuresdepth (
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 toNone
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 toNone
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 fromself_product()
.
Attributes
returns feature dimension
returns number of qubits
returns whether or not the sub-class support parameterized circuit
Methods
PauliExpansion.construct_circuit
(x[, qr, …])Construct the second order expansion based on given data.
PauliExpansion.get_entangler_map
(map_type, …)get entangle map
validate entangler map