Giter VIP home page Giter VIP logo

Comments (1)

ericchansen avatar ericchansen commented on September 2, 2024

Agreed that using atom objects would be ideal, but I ran into some problems when I tried to. That was my original implementation, but I couldn't get it to work. Here's a rough example that demonstrates the problem. The syntax isn't exact since I'm writing this off the top of my head.

s1 = schrodinger.structure # Say it has 5 atoms
s2 = schrodinger.structure # Say it also has 5 atoms

s1_a4 = s1.atom[4] # Can't remember, but this may just be an iterator
s1_a4.index
# Returns 4

s2_a3 = s2.atom[3]
s2_a3.index
# Returns 3

s12 = s1.merge(s2)

s1_a4.index
# Returns 4
s12_a4 = s12.atom[4]
s12_a4.index
# Returns 4

s1_a4 == s12_a4
# Returns False

s2_a3.index
# Returns 3
# We would want that to be 8, but it's not

s12_a8 = s12.atom[8]
s12_a8.index
# Returns 8

s12_a4 == s12_a8
# Returns False

# It gets worse
s1_a1 = s1.atom[1]
s1_a1 == st.atom[1]
# Returns False

Basically, every time you iterate over a structure's atoms, it generates the atom objects for you. The atom objects aren't stored, so there's no way to hold onto them.

I tried this sort of implementation for about a week before giving up and going to the simple integers, but maybe you can come up with a way to make it work. It would make way more sense if we could do it this way, and it would make everything so much simpler. For example, we could probably remove crap like this.

from q2mm.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.