Comments (3)
A lot of numpy operation are implemented by calling methods on objects. As long as an object implements those methods, many things will "just work". You could actually make your code work by attaching units to a numpy array instead of to each element individually.
>>> unit_list1 = np.array([10, 20])*unit.femtoseconds
>>> np.std(unit_list1)
Quantity(value=5.0, unit=femtosecond)
>>> unit_list1 = np.array([10])*unit.femtoseconds
>>> np.std(unit_list1)
Quantity(value=0.0, unit=femtosecond)
from openmm.
Numpy isn't compatible with OpenMM units. It would be nice if you could pass quantities with units into arbitrary functions and have them always work, but that's often not the case. If you want to call Numpy functions, you should first convert the quantities to ordinary numbers in a chosen set of units.
from openmm.
Thanks Peter, so mixing the two isn't best practice then.
To be frank I was surprised that one could even use numpy functions on OpenMM objects. How does numpy know what to do with the units anyway?
from openmm.
Related Issues (20)
- Brownian CustomIntegrator Algorithm HOT 5
- Periodic boundary conditions with DrudeForce HOT 4
- Charge flux in openmm HOT 3
- modeller.addSolvent error with residue templates and non-standard residues HOT 3
- Protein PDB File Loading Problem (ValueError: No template found for residue) HOT 1
- Massless atoms destroying/altering motion of system HOT 3
- TypeError in custom integrator despite correct type HOT 8
- No template found issue for C-terminal residues HOT 6
- Overflow in force calculation HOT 2
- problem [ virtural_site3 ] from GROMACS files HOT 7
- NaN forces with CustomCentroidBondForce as collective variable in CustomCVForce HOT 2
- Python wrapper: install in `CMAKE_INSTALL_PREFIX` HOT 6
- Martini simulation with no output HOT 6
- OpenMMException: Particle coordinate is nan when multiple GPUs are used HOT 6
- OpenMM 8.1.1 on Summit failing CUDA specific make tests HOT 4
- Which charmm36 forcefield version is loaded by default? HOT 3
- Interaction energy HOT 3
- big energy expression leads to wrong energies with GPU HOT 1
- Numerical problem causing NaN in energy calculation of CustomNonbondedForce HOT 1
- Pair-Energy Reporter in OpenMM HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from openmm.