LILY-QML / LLY-DML

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.
https://www.lilyqml.de
2 stars 5 forks source link

Class ALL / Method `get_state()` #34

Open xleonplayz opened 2 weeks ago

xleonplayz commented 2 weeks ago

module/all.py

Method get_state()

The get_state() method performs the following steps to determine the most probable state based on the activation matrices:

  1. Instantiate the Circuit Class

    • An instance of the Circuit class is created.
  2. Read Data

    • The method executes read_data to load the necessary data.
  3. Iterate Over All Activation Matrices

    • A loop iterates through all available activation matrices. For each activation matrix, the following sub-steps are performed:
      1. Convert Input Data
        • The convert_input_data method is called to appropriately convert the input data.
      2. Check Input Data
        • check_input_data is executed to validate the converted data.
      3. Create Initial Circuit
        • The initial circuit is created using create_initial_circuit(self).
      4. Perform Measurement
        • The measure(self, shots) method is called, where the number of shots is defined in the data.json file (e.g., "shots": 1024).
  4. Determine the Most Probable State

    • After measurement, the method analyzes which state is most likely. This state is flagged and stored in the variable self.flagged_state, including the matrix name and the corresponding state.
  5. State Determination

    • Overall, the function iterates through all activation matrices and determines the corresponding state for each matrix.

This approach ensures that all activation matrices are systematically processed to accurately determine and store the most probable state.