Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@atomistics/pairwise-potential

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

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.

  • 1.0.0
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
5
increased by150%
Maintainers
1
Weekly downloads
 
Created
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

Package last updated on 03 Sep 2018

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc