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

Entangling Capability and Expressibility #92

Merged
merged 68 commits into from
Jun 7, 2024
Merged

Conversation

stroblme
Copy link
Member

@stroblme stroblme commented Mar 25, 2024

This PR resolved #47 and #37.
The implementation includes:

  • random circuits are first generated with unbound parameters (parameters are only bound before conversion to qasm). This was necessary, because the implementation of measures requires parameter adjustment
  • implementation of the entangling capability following https://arxiv.org/abs/1905.10876
  • implementation of the expressiblity following https://arxiv.org/abs/quant-ph/0305094 as inverse of the similarity of the state integral to the Haar measure
  • both implementations of the measures were inspired by https://obliviateandsurrender.github.io/blogs/expr.html
  • adding of 'samples_per_parameter' option in 'data_generation.yml' to the amount of sampled parameters when calculating the measures
  • adding separate folder for storing the measures, so that in case something goes wrong, we don't have to start all-over again. This will result in different data locations but should not conflict with existent installations.
  • adaption of the 'data generation' pipelines to include the nodes for calculating the measures
  • adaption of the 'data science' pipeline to include the measures when combining evaluation results
  • implementation of corresponding visualizations. Both measures result in a single figure using the standard color scheme.
  • adaption of the 'data visualization' pipeline to include the nodes for generating the plots
  • docstrings for all modified methods

After some evaluations and testing:

  • added caching for both, Haar integrals and statevectors of circuits for each of the sampled parameter combinations which are identified using md5 hashes
  • converted performance critical operations to jax->jit
  • minor performance optimizations
  • sort of hacky estimate how many samples we use for the pqc based on its parameters and number of qubits
  • fixes in visualization
  • updated overview diag accordingly

Signed-off-by: lc3267 <[email protected]>
Signed-off-by: lc3267 <[email protected]>
Signed-off-by: lc3267 <[email protected]>
Signed-off-by: lc3267 <[email protected]>
Signed-off-by: lc3267 <[email protected]>
Signed-off-by: lc3267 <[email protected]>
Signed-off-by: lc3267 <[email protected]>
Signed-off-by: lc3267 <[email protected]>
Signed-off-by: lc3267 <[email protected]>
Signed-off-by: lc3267 <[email protected]>
Signed-off-by: lc3267 <[email protected]>
Signed-off-by: lc3267 <[email protected]>
Signed-off-by: lc3267 <[email protected]>
@pep8speaks
Copy link

pep8speaks commented Mar 25, 2024

Hello @stroblme! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:

Line 476:61: E203 whitespace before ':'

Comment last updated at 2024-06-06 08:58:40 UTC

Signed-off-by: lc3267 <[email protected]>
@stroblme
Copy link
Member Author

stroblme commented Mar 25, 2024

Hello @stroblme! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:

* In the file [`src/quafel/pipelines/data_generation/nodes.py`](https://github.com/cirKITers/Quafel/blob/a85c147f0a4db880badf25f8d7b0de72b230bf23/src/quafel/pipelines/data_generation/nodes.py):

Line 382:61: E203 whitespace before ':'

Comment last updated at 2024-03-25 14:32:37 UTC

ignoring, because E203 is not PEP compliant

Signed-off-by: lc3267 <[email protected]>
Signed-off-by: lc3267 <[email protected]>
Signed-off-by: lc3267 <[email protected]>
@stroblme stroblme marked this pull request as ready for review April 1, 2024 09:03
Signed-off-by: lc3267 <[email protected]>
Signed-off-by: lc3267 <[email protected]>
Signed-off-by: lc3267 <[email protected]>
Signed-off-by: lc3267 <[email protected]>
@stroblme stroblme requested a review from cDenius April 23, 2024 06:59
@cDenius
Copy link
Contributor

cDenius commented May 3, 2024

Although there is some randomness in the calculation, you should be able to reproduce the results from your source, correct? Have you done that?

It would be a nice way to check your implementation.

@stroblme
Copy link
Member Author

Although there is some randomness in the calculation, you should be able to reproduce the results from your source, correct? Have you done that?

It would be a nice way to check your implementation.

Good point, will add that!

Melvin Strobl added 4 commits May 28, 2024 20:08
Signed-off-by: Melvin Strobl <[email protected]>
Signed-off-by: Melvin Strobl <[email protected]>
Signed-off-by: Melvin Strobl <[email protected]>
Signed-off-by: Melvin Strobl <[email protected]>
@stroblme
Copy link
Member Author

stroblme commented Jun 5, 2024

Added some tests to verify reasonable values for expressibility and entangling capability as mentioned in #42

Melvin Strobl added 3 commits June 5, 2024 18:17
@stroblme stroblme mentioned this pull request Jun 6, 2024
Melvin Strobl added 3 commits June 6, 2024 10:55
Signed-off-by: Melvin Strobl <[email protected]>
Signed-off-by: Melvin Strobl <[email protected]>
Copy link
Contributor

@cDenius cDenius left a comment

Choose a reason for hiding this comment

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

Looks good Melvin!
Like the additions you made!
Go for it, buddy!

@stroblme stroblme merged commit a6e8ff8 into main Jun 7, 2024
@stroblme stroblme deleted the entangling_capability branch June 7, 2024 11:57
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.

measure entangling capability
3 participants