SaashaJoshi / piQture

piQture: A quantum machine learning library for image processing.
https://saashajoshi.github.io/piQture/
Apache License 2.0
15 stars 7 forks source link

Update directory structure for neural networks #27

Closed SaashaJoshi closed 7 months ago

SaashaJoshi commented 7 months ago

This PR handles multiple tasks:

  1. Changes the directory structure of the neural_networks module A. This change led to several follow-up changes to tensor_network_circuits module. Major change was to replace img_dims with num_qubits such that the NN layers can be applied on to the circuit with the help of tensor_network_circuit objects.
  2. Split NN layer classes into different folders for clear organization of code. 3. Add unit tests for QCNN and several NN layers. (separate PR)
  3. Add QuantumPooilingLayer3 to close #9
SaashaJoshi commented 7 months ago

Currently, layers take an input unmeasured_bits of the type(dict) that stores the unmeasured qubits and clbits of the QNN circuit. The question is if this input should instead be a list with the index of the unmeasured qubits/clbits only. Having a list structure may save us from (redundantly) storing qubits and clbits on the same indices; since measurement means both the qubit and the corresponding clbit are used.

SaashaJoshi commented 7 months ago

Currently, layers take an input unmeasured_bits of the type(dict) that stores the unmeasured qubits and clbits of the QNN circuit. The question is if this input should instead be a list with the index of the unmeasured qubits/clbits only. Having a list structure may save us from (redundantly) storing qubits and clbits on the same indices; since measurement means both the qubit and the corresponding clbit are used.

Also, the inputs num_qubits and unmeasured_bits (or qubits in some PR commits) should be mutually inclusive since the layers are built on unmeasured qubits only. So the len(unmeasured_qubits) = num_qubits, unless when unmeasured_qubits = None

SaashaJoshi commented 7 months ago

a540ab2 This commit follows up on several changes to tensor_network_circuits module. The major change was to replace img_dims with num_qubits such that the NN layers can be applied on to the circuit with the help of tensor_network_circuit objects. The test files for these changes will be updated in another PR.