You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When the conditional argument is False, i.e. when dynamic circuits are not used, a cz gate should be applied to adjacent qubits to perform the pooling function. The adjacent qubits must be in pairs, (0, 1), (1, 2) or groups (0, 1, 2), (2, 3, 4), where the phase_bits are 1, 2 and 1, 3 respectively.
However, in the current implementation of the QuantumPoolingLayer(s) when the num_qubits is odd and conditional = False, a cz is not getting applied to the last qubit. This can also be seen in the unit test test_pooling_layer.py as below,
Also consider the open boundary conditions for QCNN, as proposed in the following paper.
T. Hur, L. Kim, and D. K. Park, “Quantum convolutional neural network for classical data classification,” Quantum Machine Intelligence, vol. 4, no. 1, Feb. 2022, doi: https://doi.org/10.1007/s42484-021-00061-x.
When the
conditional
argument isFalse
, i.e. when dynamic circuits are not used, acz
gate should be applied to adjacent qubits to perform the pooling function. The adjacent qubits must be in pairs, (0, 1), (1, 2) or groups (0, 1, 2), (2, 3, 4), where thephase_bits
are 1, 2 and 1, 3 respectively.However, in the current implementation of the
QuantumPoolingLayer
(s) when thenum_qubits
is odd andconditional = False
, acz
is not getting applied to the last qubit. This can also be seen in the unit testtest_pooling_layer.py
as below,https://github.com/SaashaJoshi/quantum-image-processing/blob/828a9297f9fa1976f531b23c98ad05623c2a1390/tests/neural_networks/layers/test_pooling_layer.py#L132-L140
To pinpoint the origin of the error, the for loop here generates an incorrect group of qubits for the
cz
gate to be applied on.https://github.com/SaashaJoshi/quantum-image-processing/blob/828a9297f9fa1976f531b23c98ad05623c2a1390/quantum_image_processing/neural_networks/layers/pooling_layer.py#L152-L156
While it is sure that this bug occurs in
QuantumPoolingLayer3
, it still needs to be verified ifQuantumPoolingLayer2
shows similar behaviour.This bug was discovered after #39 was closed.
The text was updated successfully, but these errors were encountered: