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

Bugfix for the H not found on tq #257

Closed GenericP3rson closed 3 months ago

GenericP3rson commented 5 months ago

Error

tq.H()

Claims that H is not found on tq.

Problem

Essentially, the trick we used for using class for an alias results in the original name.

Proposed Solution

Therefore, I just decided to remove the all from this so the aliases are automatically exported. In addition, to ensure the other variables are not exported, I prefixed them in _. This addresses one of the bugs in the Slack.