Coder Social home page Coder Social logo

griffin-group / darkmagic Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 1.78 MB

The Dark Matter Ab initio maGnon/phonon Interaction Calculator (DarkMAGIC) is a python package for computing DM interaction rates with collective excitations based on ab initio calculations of material properties.

Home Page: https://griffin-group.github.io/DarkMAGIC/

License: MIT License

Python 100.00%
ab-initio dark-matter density-functional-theory phonon magnon

darkmagic's People

Contributors

oashour avatar

Stargazers

 avatar

Watchers

 avatar

darkmagic's Issues

MaterialParameters object is mutated by calculation

Reusing the same MaterialParameters object for multiple calculations mutates it, causing an assertion error.

Traceback (most recent call last):
  File "/pscratch/sd/a/ash/He/hcp/pres_sweep/calc_darkmagic.py", line 44, in <module>
    material = PhononMaterial(material_name, params, yaml_file)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/global/u1/a/ash/code/DarkMAGIC/darkmagic/material.py", line 271, in __init__
    properties.validate_for_phonons(n_atoms)
  File "/global/u1/a/ash/code/DarkMAGIC/darkmagic/material.py", line 90, in validate_for_phonons
    assert any(np.any(v) for v in d.values())

Implement a general binned rate attributed

The current rate attributes of the Calculator class are named and designed to maintain backward compatibility with PhonoDark. Implementing an attribute where the binned rate is a (velocity, mass, mode, bin) array should be easy. Should also implement an easy way to distinguish Umklapp processes.

JIT compilation with numba

My first thought was to use @jitclass, which I did for the numerics module in a4e2e21. However, this approach would be a long and painful road since every single class would have to be a @jitclass since they are all used in Calculator, and thus every single method in the entire package will have to be @njit compatible. This is simply not practical (nor desired, nor necessary).

The best option is a heavy refactoring of the code so that I'm computing the binned rate as a (n_velocities, n_masses, n_modes, n_bins) array, i.e., all the Single[...]Reach classes need to be heavily reworks so that I'm not looping over them and calculating the rate for each (v_e, m_chi) pair individually. Those classes should do all the setup, then the entire rate calculation can be taken outside the classes into an njitted method that does nothing but array operations.

Get rid of pymatgen as a dependency

pymatgen is a very large package and we only use a minute fraction of its functionality (a few features of the Structure class), which can easily be extracted into its own class.

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.