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

feature: Add simulator module with mcm simulator implementation #17

Merged
merged 19 commits into from
May 22, 2024

Conversation

rmshaffer
Copy link
Contributor

@rmshaffer rmshaffer commented May 13, 2024

Issue #, if available:
Merging this PR unblocks the following task: Publish autoqasm to PyPI

Description of changes:
Ports the contents of https://github.com/amazon-braket/amazon-braket-default-simulator-python/tree/mcm-sim into a new experimental simulator module in AutoQASM as a separate simulator implementation.

The simulator can be used by instantiating the Braket LocalSimulator object with the "autoqasm" backend:

import autoqasm as aq
from braket.devices.local_simulator import LocalSimulator

@aq.main
def bell_state():
    h(0)
    cnot(0, 1)
    return measure([0, 1])

device = LocalSimulator("autoqasm")
result = device.run(bell_state, shots=100).result()

Testing done:
Tests added to cover 100% of new code.

To do before merging

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.

@rmshaffer rmshaffer self-assigned this May 13, 2024
Copy link

codecov bot commented May 14, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (aafd509) to head (5698ee6).
Report is 16 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##              main       #17    +/-   ##
==========================================
  Coverage   100.00%   100.00%            
==========================================
  Files           37        44     +7     
  Lines         1687      1936   +249     
  Branches       267       319    +52     
==========================================
+ Hits          1687      1936   +249     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@rmshaffer rmshaffer marked this pull request as ready for review May 21, 2024 15:54
@rmshaffer rmshaffer requested a review from a team as a code owner May 21, 2024 15:54
setup.py Outdated Show resolved Hide resolved
yitchen-tim
yitchen-tim previously approved these changes May 22, 2024
src/autoqasm/simulator/__init__.py Outdated Show resolved Hide resolved
test/unit_tests/autoqasm/test_simulator.py Show resolved Hide resolved
@rmshaffer rmshaffer merged commit ecce2bc into main May 22, 2024
15 checks passed
@rmshaffer rmshaffer deleted the rmshaffer/mcm-simulator branch May 22, 2024 20:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants