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

Single- and two-qubit state and process tomography #246

Merged
merged 22 commits into from
Nov 10, 2024

Conversation

bornman-nick
Copy link
Contributor

There are four experiment scripts in the Use Case 4 directory, carrying out single- and two-qubit quantum state tomography, as well as single- and two-qubit standard quantum process tomography. There is additionally a helper functions file (mainly constants and matplotlib functions useful for plotting), a license file (with a BSD-3 license, required by my employer), and a serialised pickle file, PMatrix2.pkl, which is needed to solve for the process matrix in the two-qubit process tomography case (since computing the contents of the file, which are constant, took an hour or two on my local machine).

@KevinAVR KevinAVR self-assigned this Oct 2, 2024
@KevinAVR KevinAVR requested review from MichalGQM and KevinAVR October 2, 2024 14:15
@bornman-nick
Copy link
Contributor Author

It looks like the check-python-formatting check is failing because I used a match statement in some function definitions in the helper functions module. Match statements only became available in python version 3.10, whereas it looks like the checker is assuming version 3.8.

The functions can be rewritten using lots of if ... elif statements, if that helps, but the resulting code would look more verbose.

@MichalGQM
Copy link
Contributor

MichalGQM commented Oct 10, 2024 via email

@yomach
Copy link
Contributor

yomach commented Oct 10, 2024

It looks like the check-python-formatting check is failing because I used a match statement in some function definitions in the helper functions module. Match statements only became available in python version 3.10, whereas it looks like the checker is assuming version 3.8.

The functions can be rewritten using lots of if ... elif statements, if that helps, but the resulting code would look more verbose.

Hi,
Can you try to rebase on latest version of main. We just recently updated Black, and I believe/hope it will solve it.
Alternatively, can you pip install black==24.8.0 and see if it works then?

Remove comment regarding adding a wait qua statement.
@bornman-nick
Copy link
Contributor Author

It looks like the check-python-formatting check is failing because I used a match statement in some function definitions in the helper functions module. Match statements only became available in python version 3.10, whereas it looks like the checker is assuming version 3.8.
The functions can be rewritten using lots of if ... elif statements, if that helps, but the resulting code would look more verbose.

Hi, Can you try to rebase on latest version of main. We just recently updated Black, and I believe/hope it will solve it. Alternatively, can you pip install black==24.8.0 and see if it works then?

Done

@yomach
Copy link
Contributor

yomach commented Oct 10, 2024

Okay, because we generally support Python 3.8, black automatically tries to adhere to that, and therefore, it fails.
We don't have an issue with use cases not working with older Python versions, so I don't want this to be a blocking issue. After a bit of googling I decided just to exclude the problematic file, I've pushed the change to your branch. Please run formatting using black 24.8.0
Also, please add to the readme file that it only works with Python 3.10 or above.

@bornman-nick
Copy link
Contributor Author

Okay, because we generally support Python 3.8, black automatically tries to adhere to that, and therefore, it fails. We don't have an issue with use cases not working with older Python versions, so I don't want this to be a blocking issue. After a bit of googling I decided just to exclude the problematic file, I've pushed the change to your branch. Please run formatting using black 24.8.0 Also, please add to the readme file that it only works with Python 3.10 or above.

If the issue is emanating from the match case statements in the helper functions file, I'm happy to modify the functions. I'll probably get around to making the changes some time later today.

Incorporate minor language changes
Remove `reset_frame` and `reset_phase`
Add `wait(pi_len//4, f"q{qubit1}_xy", f"q{qubit2}_xy")` to cases 3, 12 and 15.
Copy link
Contributor

@KevinAVR KevinAVR left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @bornman-nick

@bornman-nick
Copy link
Contributor Author

Hi @KevinAVR, @yomach. I think I've sorted out all issues with this pull request. Will you let me know if there's anything that I still need to do before it can be merged into the main branch?

@MichalGQM MichalGQM merged commit aa75c96 into qua-platform:main Nov 10, 2024
1 check passed
@MichalGQM
Copy link
Contributor

Hey,

I am sorry for the delay on my side. I just merged it and it is in the main branch :)

Thank you for contributing to the GitHub repository!!!

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.

4 participants