HadamardAngleEmbedding#

class pyqit.core.embeddings.HadamardAngleEmbedding(n_qubits: int)[source]#

Bases: BaseEmbedding

The encoding of Mari et al. (2020): a Hadamard layer, then one RY per wire.

The Hadamards start every wire at |+>, so an angle in [-pi/2, pi/2] covers the arc from |0> to |1>. Inputs are prescaled by pi / 2, which maps a tanh layer’s output onto that range, as in the paper.

Parameters:

n_qubits (int)

References

Mari, Bromley, Izaac, Schuld, Killoran, “Transfer learning in hybrid classical-quantum neural networks”, Quantum 4, 340 (2020).

forward(inputs)[source]#

Apply H then RY on every wire. Expects inputs scaled by pi / 2.

classmethod get_test_params()[source]#

List constructor kwargs used to parametrize this class in the test suite.