amazon-braket / amazon-braket-sdk-python

A Python SDK for interacting with quantum devices on Amazon Braket
https://aws.amazon.com/braket/
Apache License 2.0
294 stars 118 forks source link

AHSAtom.py #981

Closed AbdullahKazi500 closed 1 month ago

AbdullahKazi500 commented 1 month ago

Issue

fixes #969

Description of changes:

Added factory methods to the AtomArrangement class to create various lattice arrangements, including square, rectangular, honeycomb, Bravais, and decorated Bravais lattices.

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

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

peterkomar-aws commented 1 month ago

Hey, thanks for the PR. This is a great start, but there are at least the following few things to fix:

  1. Clearly you are referring to this issue: https://github.com/amazon-braket/amazon-braket-sdk-python/issues/969, please update your PR message to make this clear.
  2. Add the factory method as a method of the existing AtomArrangement class in the existing atom_arrangement module (here: https://github.com/amazon-braket/amazon-braket-sdk-python/blob/main/src/braket/ahs/atom_arrangement.py#L57)
  3. Add tests to the corresponding test module (here: https://github.com/amazon-braket/amazon-braket-sdk-python/blob/main/test/unit_tests/braket/ahs/test_atom_arrangement.py)
  4. Implement Honeycomb, Bravais and decorated Bravais lattice construction (I recommend implementing a decorated Bravais lattice factory method first, and using it to create the rest of the factories.)
  5. Create a separate RectangularCanvas object. As a stretch goal, you could also outline how it would work with an arbitrary polygon canvas.

I am marking this PR a draft. Feel free to switch it back, once you think it's are ready for a review. (I also unchecked the two checkboxes in the PR message that says tests are passing. Feel free to check them again, once you completed the test, and indeed they are passing.)

AbdullahKazi500 commented 1 month ago

Thanks @peterkomar-aws sure I will keep working on this

peterkomar-aws commented 1 month ago

Please consolidate the work to this PR: https://github.com/amazon-braket/amazon-braket-sdk-python/pull/989