-
Notifications
You must be signed in to change notification settings - Fork 407
Add common quantum embeddings #2982
Copy link
Copy link
Labels
UnitaryHackGood issue for UnitaryHackGood issue for UnitaryHackapplicationsPertaining to Notebooks or any applicationsPertaining to Notebooks or any applicationsenhancementNew feature or requestNew feature or request
Metadata
Metadata
Assignees
Labels
UnitaryHackGood issue for UnitaryHackGood issue for UnitaryHackapplicationsPertaining to Notebooks or any applicationsPertaining to Notebooks or any applicationsenhancementNew feature or requestNew feature or request
Type
Fields
Give feedbackNo fields configured for issues without a type.
Required prerequisites
Describe the feature
Add built-in APIs for common quantum embeddings.
--
(1) Amplitude encoding:$x \mapsto \sum_i x_i |i\rangle$ , including $2^n$ with the specified pad value, e.g., zero-padding to the nearest power of $2^n$ by setting
Maps and normalizes classical features (
list,ndarrayorcudaq.State) to a quantum state by encoding values as amplitudes:padas an argument for vectors not sized topad = 0. The featured API looks like:Returns
cudaq.Statewith values[0.5773, 0.5773, 0.5773, 0](L2-norm = 1)--
(2) Angular encoding:$x_i \mapsto R_y(x_i)|0\rangle$ :
Encodes classical features (
listorndarray) as qubit rotations (e.g., with specified Ry gates):The corresponding kernel:
--
Both embedding methods are commonly used in QML, enabling developers to design models more easily and intuitively.
Comment for Unitary Hack:
We are happy to accept PRs that implement either one encoding and preferably both.