qxmt.feature_maps.pennylane.npqc module#
- class qxmt.feature_maps.pennylane.npqc.NPQCFeatureMap(n_qubits, reps, c)
Bases:
BaseFeatureMap
NPQC feature map class. Reference: https://arxiv.org/abs/2108.01039
- Parameters:
BaseFeatureMap (_type_) – base feature map class
n_qubits (int)
reps (int)
c (float)
Example
>>> import numpy as np >>> from qxmt.feature_maps.pennylane.npqc import NPQCFeatureMap >>> feature_map = NPQCFeatureMap(2, 2, 0.1) >>> feature_map.draw(x_dim=2) 0: ──RY(1.60)──RZ(1.59)──RY(1.57)─╭●──RY(1.60)──RZ(1.59)──RY(1.57)─╭●──RY(1.60)─┤ 1: ──RY(1.60)──RZ(1.59)───────────╰Z───────────────────────────────╰Z───────────┤
- __init__(n_qubits, reps, c)
“Initialize the NPQC feature map class.
- Parameters:
n_qubits (int) – number of qubits
reps (int) – number of repetitions
c (float) – scaling factor
seed (int) – random seed
- Return type:
None
- feature_map(x)
Create quantum circuit of NPQC feature map.
- Parameters:
x (np.ndarray) – input data
- Return type:
None