Socket
Socket
Sign inDemoInstall

@atomistics/pairwise-potential

Package Overview
Dependencies
0
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @atomistics/pairwise-potential

Takes a pairwise function and returns a function that can calculate the energy from a set of 3D positions.


Version published
Weekly downloads
2
Maintainers
1
Install size
21.1 kB
Created
Weekly downloads
 

Readme

Source

pairwise-potential

Takes a pairwise function and returns a function that can calculate the energy from a set of 3D positions.

Example

const LJ = require("@atomistics/lennard-jones-pairwise-js");
const PairwisePotential = require("@atomistics/pairwise-potential");

const ljp = PairwisePotential(LJ());

console.log(ljp([0,0,0, 1.01,0,0]));

> { energy: -0.9966412452432595,
>   force: Float32Array [ 0.6486654877662659, 0, 0, -0.6486654877662659, 0, 0 ] }

API

const PairwisePotential = require('@atomistics/pairwise-potential');

const potential = PairwisePotential(pairwise)
ParameterTypeDescription
pairwisepairwise potentialA pairwise potential like @atomistics/lennard-jones-pairwise-js

Returns a function that calculates the potential energy of and force on from a set of positions:

const result = potential(positions);
ParameterTypeDescription
positionsarrayA set of 3D positions in a flat array of floats, e.g., [0.0, 0.0, 0.0, 1.0, 0.0, 1.0]

Returns an object containing the energy and force:

NameTypeDescription
result.energyfloatThe energy of the potential.
result.forcefloatThe force of the potential.

Keywords

FAQs

Last updated on 03 Sep 2018

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc