LLY-DML is part of the LILY project and is a Quantum Machine Learning model. It uses so-called L-Gates. These gates are Machine Learning gates that modify their state based on an input to map to a desired state of an input.
The function is partially implemented and is currently undergoing revisions. The method's final structure should adhere to the provided pattern, but adjustments need to be made to ensure it is fully functional. It is important to build the method in a robust and stable manner, incorporating the necessary changes to achieve this goal.
Method: create
Purpose:
The create method constructs a quantum circuit where L-Gates are applied for each depth and each qubit. These L-Gates consist of a sequence of three phases: a training phase and an activation phase, followed by Hadamard gates between the phases. This method integrates the entire circuit setup, L-Gate application, and input validation into one process.
Input Parameters:
qubits (Integer): The number of qubits in the quantum circuit.
depth (Integer): The depth of the circuit, determining how many L-Gates will be applied to each qubit.
training_phases (Matrix): A matrix defining the training phases for each L-Gate. Each phase is specified per depth and qubit.
activation_phases (Matrix): A matrix containing the activation phases for each L-Gate, with corresponding phases for each depth and qubit.
Return Value:
The method returns a fully constructed quantum circuit, containing the L-Gates and their respective phases.
Workflow:
Circuit Initialization: The method initializes a quantum circuit based on the given number of qubits.
Validation of Phase Matrices: Before applying the L-Gates, the method checks if the training_phases and activation_phases are correctly dimensioned. This means that the number of rows must equal depth * 3 (each depth has 3 phases), and the number of columns must equal the number of qubits.
Application of L-Gates: For each depth and each qubit, an L-Gate sequence is applied. The L-Gate sequence consists of three phases:
Each phase (training and activation) is applied as a phase gate (p-gate) on the corresponding qubit.
After the second and third phases, a Hadamard gate (h-gate) is applied to the qubit to mix the states and create quantum interference.
Return the Circuit: After all L-Gates have been applied for each qubit and depth, the method returns the quantum circuit.
Example Usage:
The create method constructs a quantum circuit for a system with multiple qubits and a specified depth. It uses the provided training and activation phases to apply phase gates to the qubits and configure the circuit.
The L-Gate sequence ensures that each qubit undergoes a training and activation phase, with Hadamard gates in between, to promote interference between the qubits.
Disclaimer
The function is partially implemented and is currently undergoing revisions. The method's final structure should adhere to the provided pattern, but adjustments need to be made to ensure it is fully functional. It is important to build the method in a robust and stable manner, incorporating the necessary changes to achieve this goal.
Method:
create
Purpose:
The
create
method constructs a quantum circuit where L-Gates are applied for each depth and each qubit. These L-Gates consist of a sequence of three phases: a training phase and an activation phase, followed by Hadamard gates between the phases. This method integrates the entire circuit setup, L-Gate application, and input validation into one process.Input Parameters:
Return Value:
Workflow:
Circuit Initialization: The method initializes a quantum circuit based on the given number of qubits.
Validation of Phase Matrices: Before applying the L-Gates, the method checks if the
training_phases
andactivation_phases
are correctly dimensioned. This means that the number of rows must equal depth * 3 (each depth has 3 phases), and the number of columns must equal the number of qubits.Application of L-Gates: For each depth and each qubit, an L-Gate sequence is applied. The L-Gate sequence consists of three phases:
p
-gate) on the corresponding qubit.h
-gate) is applied to the qubit to mix the states and create quantum interference.Return the Circuit: After all L-Gates have been applied for each qubit and depth, the method returns the quantum circuit.
Example Usage:
The
create
method constructs a quantum circuit for a system with multiple qubits and a specified depth. It uses the provided training and activation phases to apply phase gates to the qubits and configure the circuit.The L-Gate sequence ensures that each qubit undergoes a training and activation phase, with Hadamard gates in between, to promote interference between the qubits.