Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gates in qutip-qutip #2389

Open
ajgpitch opened this issue Apr 10, 2024 · 4 comments
Open

Gates in qutip-qutip #2389

ajgpitch opened this issue Apr 10, 2024 · 4 comments
Labels
DOC Issues relating the QuTiP documentation ENH good first issue qip about the qip submodule

Comments

@ajgpitch
Copy link
Member

Problem Description

Now that qutip-qip has moved to another package, gates are not available in the main repo. This is inconvenient for examples such as the control optimization ones, where one would need to install the qutip-qip package just to access say the Hadamard or CNOT for instance.

Proposed Solution

The easiest solution would be just to copy the gates.py file from the QIP package into the main repo. Perhaps might confuse imports in qip? Also, I think that file has func defs that refer to 'controls' that might not make sense in this repo

Alternate Solutions

Have a file called operations.py. Just have a subset of the gates (operations), the most typical named unitaries - sounds less QIP like and would avoid import confusion. I think also hadamard_transform could be shortened to hadamard, but also include the original name.

Additional Context

No response

@ajgpitch ajgpitch added ENH qip about the qip submodule control about the optomal control submodule good first issue code code-related, independently on the underlying physics simulation. labels Apr 10, 2024
@BoxiLi
Copy link
Member

BoxiLi commented Apr 10, 2024

We have kept many gates in qutip/core/gates. Not all of them but surely for cnot, hadamard etc.

@BoxiLi
Copy link
Member

BoxiLi commented Apr 10, 2024

It is actually very similar to your solution. We should add this to the migration guide.

@ajgpitch ajgpitch added good first issue DOC Issues relating the QuTiP documentation and removed control about the optomal control submodule good first issue code code-related, independently on the underlying physics simulation. labels Apr 10, 2024
@ajgpitch
Copy link
Member Author

Thanks @BoxiLi
Okay, embarrassingly, I was still in my update-4,x branch, so hence didn't find the file.

Still, I did try a lot of stuff like from qutip import hadamard_transform (in other envs) that didn't work, before I found (with some help) that from qutip import gates is a good option. It seems like there was a deliberate choice not to expose the function names individually.

A search for "hadamard_transform" or "gates" does not return anything helpful. Does it need pointing at in the docs build?

@BoxiLi
Copy link
Member

BoxiLi commented Apr 10, 2024

That seems true, gates are missing from the documentation. This could be a Good first issue. To add them back to the documentation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
DOC Issues relating the QuTiP documentation ENH good first issue qip about the qip submodule
Projects
None yet
Development

No branches or pull requests

2 participants