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

example of charge modeling #72

Open
mofeilu opened this issue May 28, 2024 · 1 comment
Open

example of charge modeling #72

mofeilu opened this issue May 28, 2024 · 1 comment

Comments

@mofeilu
Copy link

mofeilu commented May 28, 2024

I am interested in using hippynn to do charge modeling, is there any working examples of training hip-nn to charges or dipole moments as in the paper "Discovering a Transferable Charge
Assignment Model Using Machine Learning"?

In the example folder, I could see energy training case but no explicit charge training ones.

Thanks,

@lubbersnick
Copy link
Collaborator

Thanks @mofeilu !

I will try to add an example, but in the mean time the main relevant code would look something like this:

    # model inputs
    species = inputs.SpeciesNode(db_name="Z")
    positions = inputs.PositionsNode(db_name="R")
    
    # Model computations
    network = networks.Hipnn("HIPNN", (species, positions), module_kwargs=network_params)
    henergy = targets.HEnergyNode("HEnergy", network,db_name="E")
    hcharge = targets.HChargeNode("HCharge",network,db_name="Q")
    dipole = physics.Dipole("QDipole",hcharge,db_name="D")

Then the hcharge and dipole can be used in the loss function and etc. The db_name quantity specifies how the quantity is called in the database.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants