QuantumModuleFromOps#

class torchquantum.layer.QuantumModuleFromOps(ops)[source]#

Bases: QuantumModule

Initializes a QuantumModuleFromOps instance.

Parameters:

ops (List[tq.Operation]) – List of quantum operations.

__init__(ops)[source]#

Initialize the QuantumModule.

Returns:

None.

Examples

>>> qmodule = QuantumModule()

Methods

forward(q_device: QuantumDevice)[source]#

Performs the forward pass of the quantum module.

Parameters:

q_device (tq.QuantumDevice) – Quantum device to apply the operations on.

Returns:

None

Attributes

training: bool#