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

add supports for more basic operations and layers #134

Closed
Hanrui-Wang opened this issue May 20, 2023 · 6 comments
Closed

add supports for more basic operations and layers #134

Hanrui-Wang opened this issue May 20, 2023 · 6 comments
Assignees
Labels
enhancement New feature or request unitaryhack

Comments

@Hanrui-Wang
Copy link
Collaborator

Hanrui-Wang commented May 20, 2023

In order to enrich the supported operations of tq, we need your help on adding more functionalities.

Please firstly identity the gates that have not been supported by torchquantum, you can find them by having a look at other frameworks such as Qiskit, Cirq etc. You can identity the gates that not supported by looking at qiskit.circuit.library.
Such as the SdG gate:
SdgGate

For the simplest non-parameterized gates, you need firstly add their unitary matrix to tq.functional file:

and also add their functions. Then you can add a class to the tq.operators files and finally add test function to test/test_op.py. You may create new test files.

You may also implement other template layers according to qiskit.circuit.library. https://qiskit.org/documentation/apidoc/circuit_library.html

Please let us know if you have any questions or need any instructions!

@Hanrui-Wang Hanrui-Wang added the enhancement New feature or request label May 20, 2023
@Hanrui-Wang Hanrui-Wang changed the title Enhance circuit simulation performance Add supports to more gates in torchquantum May 25, 2023
@Hanrui-Wang Hanrui-Wang changed the title Add supports to more gates in torchquantum Add supports to more basic operations in torchquantum May 25, 2023
@Hanrui-Wang Hanrui-Wang changed the title Add supports to more basic operations in torchquantum add supports for more basic operations and layers May 26, 2023
bopardikarsoham added a commit to bopardikarsoham/torchquantum that referenced this issue May 27, 2023
@pandey-tushar
Copy link
Contributor

Hi,
I have added the code for SDG gate in functional.py, added a class to the operators file and added the test_case as well. Should I do a PR/Merge request? I can also provide you the forked repo in case you want to check before merging.

@bopardikarsoham
Copy link
Contributor

Hi, @Hanrui-Wang
Apart from some Quantum Gates that I have added in my PR #138 , should I also add some ansatz layers/N-local circuits like RealAmplitudes, EfficientSU2, Two-Local, etc. that are used quite often in Qiskit Machine Learning

@Hanrui-Wang
Copy link
Collaborator Author

Hi, @Hanrui-Wang Apart from some Quantum Gates that I have added in my PR #138 , should I also add some ansatz layers/N-local circuits like RealAmplitudes, EfficientSU2, Two-Local, etc. that are used quite often in Qiskit Machine Learning

Hi bopardikarsoham,

Yes, ansatz layers/N-local layers are also very important so they are highly encouraged! When you implement RealAmplitudes, EfficientSU2, Two-Local, it would be better to also have similar hierarchy of classes as qiskit.

Hanrui-Wang added a commit that referenced this issue Jun 13, 2023
Hanrui-Wang added a commit that referenced this issue Jun 13, 2023
Adding more gates, for issue #134
@YuNariai
Copy link
Contributor

I add a PR for QFT in #142

@d-bharadwaj
Copy link
Contributor

Made changes and Added basic gates for issue #134

@Hanrui-Wang
Copy link
Collaborator Author

Hanrui-Wang commented Jun 14, 2023

Congrats @pandey-tushar, @bopardikarsoham and @dhanvi-bharadwaj for successfully merged the pull requests and thank you for your contributions! Since UnitaryHack comes to an end, I will close this issue but we will very appreciate if you can continue to contribute to new functionalities in torchquantum!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request unitaryhack
Projects
None yet
Development

No branches or pull requests

5 participants