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

WIP: Quantum partition function #17

Closed
wants to merge 26 commits into from
Closed

Conversation

AoyuQC
Copy link
Contributor

@AoyuQC AoyuQC commented Nov 14, 2022

Issue #, if available:

Description of changes:

Testing done:

Merge Checklist

Put an x in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your pull request.

General

Tests

  • I have added tests that prove my fix is effective or that my feature works (if appropriate)
  • I have checked that my tests are not configured for a specific region or account (if appropriate)

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@mbeach-aws mbeach-aws marked this pull request as draft November 15, 2022 18:33
@mbeach-aws mbeach-aws marked this pull request as ready for review November 15, 2022 20:49
@mbeach-aws mbeach-aws marked this pull request as draft November 15, 2022 21:14
@AoyuQC AoyuQC marked this pull request as ready for review November 16, 2022 05:13
@mbeach-aws mbeach-aws marked this pull request as draft November 23, 2022 14:13
@review-notebook-app
Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@AoyuQC AoyuQC marked this pull request as ready for review December 14, 2022 08:16
@zmohammad01
Copy link
Contributor

@mbeach-aws @christianbmadsen I believe this PR is just waiting for our team to review?

@christianbmadsen
Copy link
Contributor

@mbeach-aws @christianbmadsen I believe this PR is just waiting for our team to review?

Acknowledged. We will take another look. Thanks for the nudge!

@licedric licedric requested review from a team and removed request for a team February 24, 2023 18:24
@licedric
Copy link
Contributor

I wonder if it makes sense to describe a bit more what the functions are doing?

circuit = None

if function == "shor":
print("shor's algorithm for iccc-check hasn't been implemented!")
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
print("shor's algorithm for iccc-check hasn't been implemented!")
print("Shor's algorithm for iccc-check hasn't been implemented!")

Copy link
Contributor

Choose a reason for hiding this comment

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

Also do you plan to implement this function? If not you should probably remove it.



@circuit.subroutine(register=True)
def quantum_partition_function(
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think the comments in this function sufficiently describe what the function does. Could you flesh out the docstring or at least add a reference?


def run_quantum_partition_function(
potts_model: dict,
step: str,
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there a reason to use the step keyword here instead of putting each step as a separate function?

if step == "pre":
print("Classical Preprocessing to [n,k] Code")
Ga = potts_model["graph-model"]
# q = potts_model["q-state"]
Copy link
Contributor

Choose a reason for hiding this comment

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

What's this line?



def run_quantum_partition_function(
potts_model: dict,
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe you should consider defining potts_model as an object instead. Otherwise it is hard for a user to tell what should go in here

'graph-model': networkx graph to save the definition of potts model
'q-state': q-state of potts model
'qft-func': dictionary to save information for quantum fourier transform function
'task': braket task for quantum fourier transform
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
'task': braket task for quantum fourier transform
'task': Braket task for quantum fourier transform

@speller26
Copy link
Member

In general, the notebook needs more explanation than just the code blocks; you should be interleaving code and markdown cells, with a markdown cell before each code block explaining what is happening, with the math if applicable.

@AoyuQC AoyuQC changed the title Quantum partition function WIP: Quantum partition function Feb 27, 2023
@codecov-commenter
Copy link

codecov-commenter commented Jul 10, 2023

Codecov Report

Patch coverage: 48.10% and project coverage change: -3.71 ⚠️

Comparison is base (700dbbf) 100.00% compared to head (828c481) 96.29%.

❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more.

Additional details and impacted files
@@             Coverage Diff             @@
##              main      #17      +/-   ##
===========================================
- Coverage   100.00%   96.29%   -3.71%     
===========================================
  Files           26       28       +2     
  Lines         1028     1107      +79     
  Branches       161      197      +36     
===========================================
+ Hits          1028     1066      +38     
- Misses           0       34      +34     
- Partials         0        7       +7     
Impacted Files Coverage Δ
...m_partition_function/quantum_partition_function.py 47.43% <47.43%> (ø)
.../algorithms/quantum_partition_function/__init__.py 100.00% <100.00%> (ø)

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@peterkomar-aws
Copy link
Contributor

Hello AoyuQC, This PR has had little activity; I will close it for now. You are welcome to come back and work on it and reopen it any time. You can also consider developing this work further in a sperate repo of yours and highlighting it on in Braket Algorithm library "Community repos" section, which we recently added. I hope this helps.

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.

8 participants