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

Implement fromBlochVector #26

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

marwahaha
Copy link
Contributor

fixes #5

One way I was testing was by using

fromBlochVector(1, 0, 0).toBlochSphere().vector

and seeing if the output matches the input.

@stewdio
Copy link
Owner

stewdio commented Sep 17, 2020

This is great. Can you add variable declarations in your code? Something like:

const
aReal = ( 0.5 + 0.5 * z ) ** 0.5,
a = new Q.ComplexNumber( aReal, 0 ),
b = new Q.ComplexNumber( x / 2 / aReal, y / 2 / aReal )

That way aReal, a, and b don’t fall into the global scope by accident. I think at that point it will be good for a merge.

@marwahaha
Copy link
Contributor Author

Ok, I've added them :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bloch Sphere conversion
2 participants