mit-han-lab / torchquantum

A PyTorch-based framework for Quantum Classical Simulation, Quantum Machine Learning, Quantum Neural Networks, Parameterized Quantum Circuits with support for easy deployments on real quantum computers.
https://torchquantum.org
MIT License
1.3k stars 197 forks source link

NameError: name 'Op2QAllLayer' is not defined #246

Closed yezhuoyang closed 6 months ago

yezhuoyang commented 7 months ago

In the "torchquantum\examples\param_shift_onchip_training\param_shift.py" example, there is a bug:

image

In the class file

torchquantum\torchquantum\layer\layers\seth_layer.py

Op2QAllLayer and Op1QAllLayer are used but not imported.

Op1QAllLayer can be imported from layer.py, but Op2QAllLayer is not defined in the module.

image

yezhuoyang commented 7 months ago

Same kind of issue when I run

torchquantum\examples\quanvolution\quanvolution_trainable_quantum_layer.py

image

GenericP3rson commented 6 months ago

Looked into this, and I think your branch may be outdated. I recommend merging the latest updates from dev!