amazon-braket-sdk-python icon indicating copy to clipboard operation
amazon-braket-sdk-python copied to clipboard

Factory methods for AHS AtomArrangments

Open peterkomar-aws opened this issue 1 year ago • 11 comments

Describe the feature you'd like Currently there is a single low-level constructor for AtomArrangements, which creates an empty atom arrangement object, after which its add method can be used to add atoms.

Use cases of condensed matter physics often require specifying atom arrangements with regular structure, such as square, triangle, honeycomb lattices. To specify these lattices, currently one need to explicitly program the coordinates of each atom in lattice. It would be much better to be able to use pre-packaged factory methods to create these arrangements, and maybe even the most general 2-d decorated Bravais lattice too.

A good reference on decorated Bravais lattices: https://courses.physics.illinois.edu/phys560/sp2011/lecture/Phys560Notes-3.pdf

How would this feature be used? Please describe. Atom arrangements could be defined by defining a regular lattice structure and a canvas where the actual sites are placed.

  1. Square lattice
    canvas_boundary_points = [(0,0), (7.5e-5, 0), (0, 7.6e-5), (7.5e-5, 7.6e-5)]
    canvas = Canvas(canvas_boundary_points)
    d = 4e-6
    register = AtomArrangement.from_square_lattice(d, canvas)
    
  2. Rectangular lattice
    dx = 4e-6
    dy = 6e-6
    register = AtomArrangement.from_rectangular_lattice(dx, dy, canvas)
    
  3. Honeycomb lattice
    d = 6e-6
    register = AtomArrangement.from_honeycomb_lattice(d, canvas)
    
  4. Bravais lattice
    a1 = (0, 5e-6)
    a2 = (3e-6, 4e-6)
    register = AtomArrangement.from_bravais_lattice(a1, a2, canvas)
    
  5. Decorated Bravais lattice
    a1 = (0, 10e-6)
    a2 = (6e-6, 8e-6)
    basis = [(0,0), (0, 5e-6), (4e-6, 2e-6)]
    register = AtomArrangement.from_bravais_lattice(a1, a2, canvas, basis=basis)
    

Describe alternatives you've considered One alternative to the API from_bravais_lattice method above would be to provide n1, n2 repetition numbers of the unit cell instead of the Canvas object. This would however not allow us to fit the atom arrangement into a pre-defined bounding box, and would not allow us to create staggered arrangements, where say row 1 contains unit cells 0,1,2,3, and row 2 contains unit cells 1,2,3,4, and row 3 contains unit cells 2,3,4,5.

Additional context Useful links:

  • https://en.wikipedia.org/wiki/Bravais_lattice
  • https://courses.physics.illinois.edu/phys560/sp2011/lecture/Phys560Notes-3.pdf
  • https://en.wikipedia.org/wiki/Point_in_polygon

peterkomar-aws avatar May 07 '24 21:05 peterkomar-aws

Hi @peterkomar-aws, thank you for raising this suggestion. This seems to be a good first issue for new contributors so I shall add that tag on.

AbeCoull avatar May 08 '24 16:05 AbeCoull

Hi @math411 my PR #981 Addresses the issue for UF Hack

AbdullahKazi500 avatar May 30 '24 21:05 AbdullahKazi500

HI @AbdullahKazi500 , thanks for the PR. It's a good start but needs more work, please let us know if you plan to keep working on it.

peterkomar-aws avatar May 31 '24 19:05 peterkomar-aws

@peterkomar-aws Hi peter there is an update I will soon report

AbdullahKazi500 avatar Jun 02 '24 20:06 AbdullahKazi500

atom @peterkomar-aws

AbdullahKazi500 avatar Jun 04 '24 12:06 AbdullahKazi500

@AbdullahKazi500 , please consolidate your work to a single feature branch and single PR. Tests will not pass otherwise. (For how to do it, see e.g. https://webapps.stackexchange.com/questions/95940/how-can-i-change-multiple-files-and-submit-them-in-one-pull-request-on-github)

peterkomar-aws avatar Jun 04 '24 13:06 peterkomar-aws

ok @peterkomar-aws I will look into it

AbdullahKazi500 avatar Jun 04 '24 13:06 AbdullahKazi500

Hi @peterkomar-aws I have added #988 #987 #985 all the Pull requests into one Final Pull request---- #989
I have not added the test PR #986 Into #989 because it was in a different directory so now you only have to review the two PRs below #989 #986 Thank you I hope it is not an issue

AbdullahKazi500 avatar Jun 04 '24 16:06 AbdullahKazi500

Thank you @AbdullahKazi500 , the test and the code need to live on the same branch before the github actions can test them. Please add them into a single PR.

peterkomar-aws avatar Jun 04 '24 16:06 peterkomar-aws

Okay that works @peterkomar-aws peter can you specify if I have to add some tests from the repository as well if yes do I Have to add all of them because I Have added my Unit tests

AbdullahKazi500 avatar Jun 04 '24 16:06 AbdullahKazi500

@peterkomar-aws Added existing tests as well as my own tests to validate in the final PR

AbdullahKazi500 avatar Jun 04 '24 16:06 AbdullahKazi500

Closing in favor of #1081.

rmshaffer avatar May 21 '25 00:05 rmshaffer