-
-
Notifications
You must be signed in to change notification settings - Fork 46k
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
quantum_teleportation.py #6632
quantum_teleportation.py #6632
Conversation
This code is for the #Hacktoberfest. This file run the quantum teleportation circuit using Qiskit.
for more information, see https://pre-commit.ci
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please typehint the functipn return type
quantum/quantum_teleportation.py
Outdated
|
||
def quantum_teleportation( | ||
theta: float = np.pi / 2, phi: float = np.pi / 2, lam: float = np.pi / 2 | ||
): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What type does this return?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This return the counts probabilities of the qubit teleported.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@KevinJoven11 Then indicate that with the python return typehint.
For example:
def add(a: int, b: int) -> int:
return a + b
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! I think that I did it in one of the pull request. Name "python return typehint solved".
quantum/quantum_teleportation.py
Outdated
|
||
if __name__ == "__main__": | ||
print( | ||
f"Total count for teleported state is: {quantum_teleportation(np.pi/2, np.pi/2, np.pi/2)}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the function has default values then you don't need to pass anything in
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perfect!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Relying only on the default values sounds boring to me. We want to test multiple sets of values.
Co-authored-by: Caeden <caedenperelliharris@gmail.com>
Co-authored-by: Caeden <caedenperelliharris@gmail.com>
for more information, see https://pre-commit.ci
This code is for the #hacktoberfest
This circuit run the teleportation circuit using Qiskit. You can change the teleported state as preference.
Describe your change:
I add the quantum teleportation algorithm using qiskit. This is my first Pull Request let me know if I did it well.
Best,
Checklist:
Fixes: #{$ISSUE_NO}
.