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

Factory methods for AHS AtomArrangments #969

Open
peterkomar-aws opened this issue May 7, 2024 · 11 comments · May be fixed by #989
Open

Factory methods for AHS AtomArrangments #969

peterkomar-aws opened this issue May 7, 2024 · 11 comments · May be fixed by #989
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@peterkomar-aws
Copy link
Contributor

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:

@AbeCoull AbeCoull added the enhancement New feature or request label May 8, 2024
@AbeCoull
Copy link
Contributor

AbeCoull commented May 8, 2024

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 AbeCoull added the good first issue Good for newcomers label May 8, 2024
@AbdullahKazi500
Copy link

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

@peterkomar-aws peterkomar-aws mentioned this issue May 31, 2024
5 tasks
@peterkomar-aws
Copy link
Contributor Author

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.

@AbdullahKazi500
Copy link

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

@AbdullahKazi500
Copy link

AbdullahKazi500 commented Jun 4, 2024

atom
@peterkomar-aws

@AbdullahKazi500 AbdullahKazi500 mentioned this issue Jun 4, 2024
5 tasks
@peterkomar-aws
Copy link
Contributor Author

@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)

@AbdullahKazi500
Copy link

ok @peterkomar-aws I will look into it

AbdullahKazi500 added a commit to AbdullahKazi500/amazon-braket-sdk-python that referenced this issue Jun 4, 2024
@AbdullahKazi500
Copy link

AbdullahKazi500 commented Jun 4, 2024

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

@peterkomar-aws
Copy link
Contributor Author

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.

@AbdullahKazi500
Copy link

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
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment