libatoms / matscipy Goto Github PK
View Code? Open in Web Editor NEWMaterials science with Python at the atomic-scale
Home Page: http://libatoms.github.io/matscipy/
License: GNU Lesser General Public License v2.1
Materials science with Python at the atomic-scale
Home Page: http://libatoms.github.io/matscipy/
License: GNU Lesser General Public License v2.1
This is a brilliant project, many thanks for the help in researches.
How about adding a citation guide so that we can cite this repo?
Dear authors,
Generally speaking, the software runs more or less as described in the documentation. However, there are some comments in this regard:
samples_pb_c2d.py
and samples_pnp_c2d.py
examples results in the following error: ModuleNotFoundError: No module named 'matscipy.electrochemistry.utility'
. The error for samples_pnp_by_fenics_fem.py
is related to lack of matscipy.electrochemistry.poisson_nernst_planck_solver_fenics
module.P.S. This issue is related to openjournals/joss-reviews#5668
I am a bit confused about the license, the LICENSE
file states GPL 2.0
while the setup.py
file states LGPL 2.1+
.
It may not be worth fixing, so maybe it's just a "won't fix", but the ASE new FixSymmetry constraint confuses matscipy.elasticity. If the constraint is applied when you start computing elastic constants, the strains that it thinks it's applying don't actually take effect, and you get garbage elastic constants as a result. One consistent alternative is for matscipy to have a keep_symmetry argument, which applies a re-computed symmetry constraint after each strain but before the relaxation (so strains can break the symmetry but the relaxations cannot break it further).
The current release fails with latest numpy and ASE, so we're overdue for a new one. Does anyone have anything they'd like to merge before we go ahead and do this? I think all the new wheels are working, so will be nice to get them on PyPI too.
Test should run when pytest
is executed in the main directory.
I just encountered behavior from neighbour_list, which I had not expected and which seems strange / undesirable to me when I call the function and give a single number for the cutoff
ValueError: object of too small depth for desired array
from _matscipy.neighbour_list.I realize that the documentation states that you can give "A single float" specifically, but I don't see an obvious reason why "5" should not be interpreted as "5.0".
It would be good to install Atomistica in the Travis-CI environment @pastewka do you think this is possible?
I am trying to use an EAM potential for FeH, and have a .fs
file. When I pass it to the matscipy calculator, I get the same energy that the standard ASE EAM calculator gives, but the forces are different. Geometry optimisation fails with the matscipy calculator, so I that is the wrong one. Am I doing something wrong?
import matscipy
import ase
from ase.lattice.cubic import BodyCenteredCubic
import numpy as np
calc1 = matscipy.calculators.eam.EAM("pot.fs", kind="eam/fs")
calc2 = ase.calculators.eam.EAM(potential='pot.fs')
a = BodyCenteredCubic(directions=[(1,0,0), (0,1,0), (0,0,1)], size=(3,3,3), symbol='Fe', pbc=True, latticeconstant=2.855)
a.append(ase.Atom('H', (0.0,a0*0.25,a0*0.5)))
a.set_calculator(calc1)
e1 = a.get_potential_energy()
f1 = a.get_forces()
a.set_calculator(calc2)
e2 = a.get_potential_energy()
f2 = a.get_forces()
print(e1-e2)
print(np.max(f1-f2))
comes back with
2.842170943040401e-14
0.028209307473157738
if I don't add the hydrogen, the forces are the same (even after a rattle).
The new implementation of the Hessian does not yet work for atomic system with multiple species.
On Windows, when I execute "python setup.py build", it says
c = os.path.basename(self.compiler.compiler[0])
AttributeError: 'MSVCCompiler' object has no attribute 'compiler'. Did you mean: 'compile'?
What should I do? Thanks
I'm keen to try out the new EAM Hessian functionality - thanks @wgnoehring for contributing this!
I'd like to apply to a system which is large in 2 dimension but narrow in the 3rd dimension, and I see the comment here requires i-j pairs to be unique.
Is there a fundamental reason why this is restricted to systems larger than cutoff in all dimensions? Couldn't we label matrix element by (i, j, shift)
rather than just (i, j)
?
Should we switch the C code to C++ and pybind11? My guess is this would lead to a C++ code that is half the size of what we have currently, but we would have a dependency on pybind11 (which is actually just a bunch of C++ headers).
There are symlinks in matscipy/cli/electrochemistry
that make trouble when checking out on non-Linux system.
@jotelha - please remove those symlinks
I'd like to setup cibuildwheel to build binary wheels using GitHub Actions that we can release on PyPI. This would also help with issues like #57 requesting support on a wider range of platforms. I've had good success doing this with f90wrap and quippy, and matscipy should be simpler as there's no Fortran (although there is C++, so #96 would still be valuable).
I'm trying to set up a github CI that uses matscipy, and attempting to install using from the github repo fails, e.g. https://github.com/libAtoms/pymatnext/actions/runs/4779137831/jobs/8496016926
I'm going to try to reproduce outside the github CI.
The electrochemistry module samples discrete coordinate sets from classical continuum solutions to Poisson-Nernst-Planck systems. It consists of three components,
poisson_nernst_planck_solver.py
) , or poisson_nernst_planck_solver_fenics.py
) , more robustcontinuous2discrete.py
that samples point coordinates from continuous distributionssteric_correction.py
that uses the algorithm of packmol, described in L. Martinez, R. Andrade, E. G. Birgin, and J. M. Martínez, “PACKMOL: A package for building initial configurations for molecular dynamics simulations,” J. Comput. Chem., vol. 30, no. 13, pp. 2157–2164, 2009, doi: 10/chm6f7, to assure a minimum distance between point coordinates.A chain of these components may generate molecular coordinates that approximately resemble ion distributions in classical electrochemical double layer theory and may serve as initial configurations for atomistic simulations.
@jotelha elaborate and cast this into markdown snippet for JOSS submission.
I'm having trouble with the atomic_strain() calculation. I am passing in a crack slab that is thin in the z direction, and then the relaxed version of it, and computing the atomic strain. Some atoms come back with eps_zz = -1, there are domains of these, and the domain walls have strange strains (and large residuals in the least squares fit). The image below shows the hydrostatic strain. The zz strain essentially looks the same.
EAM tables of kind 'eam' (DYNAMO funcfl format) contain the effective charge function :math:z_i
, rather
than the pair potential phi_ij
. The pair potential for elements i
and j
can be calculated from the charge functions as r*phi_ij=z_i z_j
, see https://lammps.sandia.gov/doc/pair_eam.html
. An additional prefactor 27.2*0.529
may be
necessary in order to convert to units of electronvolt.
I can't see where phi_ij
is calculated from z_i
in the matscipy/calculators/eam/io.py
or
matscipy/calculators/eam/calculator.py
. It seems that z_i
is directly
assigned to rep
. So the pair potential energy is calculated from z_i
, and not from phi_ij
.
Therefore, I believe that the current implementation of the eam
style is wrong. The other styles
should be OK, because they store the pair potentials, and not the charge function.
Hi, matscipy
is a fantastic work, really love it.
But I got a question when generating the strained configuration:
In elasticity.py/generate_strained_configs
function:
T = np.eye(3) + Voigt_6_to_full_3x3_strain(strain)
at.set_cell(np.dot(T, at.cell.T).T, scale_atoms=False)
at.positions[:] = np.dot(T, at.positions.T).T
at.info['strain'] = T - np.eye(3)
I wonder why the new cell is generated in that way, is there any underlying theory? np.dot(T, at.cell.T).T
seems to be equivalent to a simpler form of np.dot(T, at.cell)
Thank you very much.
Greetings!
I noticed that method alpha_num_order referred a StackOverflow post, while a recent comment to it noticed that it doesn't work for sorting sets of version numbers alphanumerically; e.g., v1.0.1, v3.5.3, v3.2.4.
I'm trying to learn the usefulness of such small updates on StackOverflow. Would this comment help improve your code? I understand that might not happen in real life situation. In that case, do you think this comment can help prevent future defect (if the code were reused somwhere else)?
I'll really appreciate it if you could kindly give me some feedback or suggestions. Thank you very much for your time.
Have a nice day!
hi Guys!
Vikram and I were reviewing the code in get_delta_plus_epsilon(), because we wanted to understand exactly what was being calculated. Here are some suggestions:
you compute the deformation matrix, which is indeed delta+epsilon, as suggested by the name of the function, but then the name of the variable into which it is accumulated is just called epsilon, which is confusing.
The deformation matrix that is thus computed is not symmetric, so can include rotations. we suggest to take those out, using M.T*M
To actually get a strain, one has to subtract the identity, so we suggest that is done, so the final thing returned should be 0.5 (M.TM - I) where M is the thing accumulated in get_delta_plus_epsilon()
The neighbor list is currently sorted by first index only, it may be beneficial for some applications to have a fully sorted neighbor list. This would make neighbor list construction slower, but only slightly so. Any opinions on this?
See closed PR #122 for previous attempt
There is some problem with the poisson ratio calculations.
Here is an example script (needs quippy for the potential, but other EAMs should work), which first computes the poisson ratio in the cubic bcc unit cell. Then I ask it to compute by pulling in the (0,1,1) direction, and it gives a silly number (0.6), then I create a rotated unit cell which has the y axis along the (0,1,1), and now the poisson ratio function (pulling along y) gives a sensible answer.
I know there are other ways of getting at the poisson ratio, using the elastic_moduli function for example, I tried that and both answers are returned in an unsymmetric nu matrix. someone who understands these things should take a good look at this, I'm pretty sure the poisson_ratio() function is broken.
poisson_ratio_bug.tar.gz
Very rarely, I get a crash inside matscipy's neighbor list code. The crash happens in neighbours.c
, specifically in
PyObject *py_ret = PyTuple_New(strlen(quantities));
I added earlier references to strlen(quantities)
, and they work until you get to
#if PY_MAJOR_VERSION >= 3
Py_DECREF(py_bquantities);
#endif
Indeed, quantities
is set by what looks to me like it could just be a reference to the incoming python object, not a copy
#if PY_MAJOR_VERSION >= 3
PyObject *py_bquantities = PyUnicode_AsASCIIString(py_quantities);
char *quantities = PyBytes_AS_STRING(py_bquantities);
#else
char *quantities = PyString_AS_STRING(py_quantities);
#endif
If the Py_DECREF
makes the pointer invalid (python documentation suggests that it can, from what I can tell), that would explain why accessing later sometimes leads to a seg fault. Should it be copied, or move the PyDECREF
to later in the routine, once quantities
is no longer needed?
Is there a reason why the EAM calculator lies about its energy not being force_consistent (in the ASE sense) ?
import ase
import ase.build
from ase.constraints import FixAtoms,StrainFilter,UnitCellFilter
from ase.optimize.precon import PreconLBFGS
from matscipy.calculators.eam import EAM
calc = EAM("PotentialB.fs", kind="eam/fs")
Fe = ase.build.bulk("Fe", "bcc", a=2.8, cubic=True)
Fe.set_calculator(calc)
opt = PreconLBFGS(UnitCellFilter(Fe, mask=[1,1,1,0,0,0]))
opt.run()
errors with
PropertyNotImplementedError: Force consistent/free energy ("free_energy") not provided by EAM calculator
So far, while citing matscipy
in our papers I had to use a web citation to the repository that always feels a bit ad-hoc. Thus I was thinking that it would be nice to have a paper published to be able to formally cite the code. Moreover, it can help all of us to get more formal recognition of our efforts. This issue is essentially to discuss how we can achieve this.
After a short discussion about it wit @jameskermode we decided that Journal of Open Source Software looks like a nice option. It requires only a very short (250-1000 words) high level description of the software, but the review is more focused on the software itself: installation, tests coverage and documentation. You can find more details on submission requirements and reviewer checklist pages.
We should host the paper.md
file as a part of the repository, that can be in a short lived branch that is never merged to the main repository. Then everyone can add a small bit with the description of the parts of the code that they developed together with more general description. I am happy to volunteer to do the bookkeeping for this branch and the submission itself.
It seems to me that in the current shape matscipy
already passes most of the requirements and writing a short summary should not take too long. However, before starting working on the submission it makes sense to understand if there are parts of matscipy
that require a significant rework before the submission. I would suggest using the discussion on this issue to provide your opinions. On my site, I probably should enable building the documentation for the dislocation.py
module as well as to think about solving a dependency on atomman
package.
I am happy to discuss other options and suggestions as well.
ASE's atoms object has a new celldisp parameters that specifies the origin of the cell. The neighbor list will break is it is present and not (0,0,0).
Consider a dimer:
from ase import Atoms
from ase.units import eV, Ang, GPa
from matscipy.neighbours import neighbour_list
d = 2.5*Ang
a = Atoms('2Cu', positions=[(0., 0., 0.), (0., 0., d)])
ij = neighbour_list('ij', a, 3.0)
The ase.Atoms
constructor correctly sets pbc=False
for the zero-length vectors.
The current implementation fails with a LinAlgError
when trying to invert the cell.
Traceback (most recent call last):
File "neigh_pbc_test.py", line 7, in <module>
ij = neighbour_list('ij', a, 2.0)
File "/Users/jameskermode/.julia/v0.5/Conda/deps/usr/lib/python2.7/site-packages/matscipy/neighbours.py", line 127, in neighbour_list
np.linalg.inv(a.cell.T), a.pbc,
File "/Users/jameskermode/.julia/v0.5/Conda/deps/usr/lib/python2.7/site-packages/numpy/linalg/linalg.py", line 513, in inv
ainv = _umath_linalg.inv(a, signature=signature, extobj=extobj)
File "/Users/jameskermode/.julia/v0.5/Conda/deps/usr/lib/python2.7/site-packages/numpy/linalg/linalg.py", line 90, in _raise_linalgerror_singular
raise LinAlgError("Singular matrix")
numpy.linalg.linalg.LinAlgError: Singular matrix
Since the inverse shouldn't be needed when pbc=False
, I tried the following patch:
index 30096ba..c8567de 100644
--- a/matscipy/neighbours.py
+++ b/matscipy/neighbours.py
@@ -123,7 +123,12 @@ def neighbour_list(quantities, a, cutoff, *args):
np.bincount(i, weights=pair_forces[:, 2], minlength=len(a))
"""
+ if np.any(a.pbc):
+ invcell = np.linalg.inv(a.cell.T)
+ else:
+ invcell = np.eye(3)
+
return _matscipy.neighbour_list(quantities, a.cell,
- np.linalg.inv(a.cell.T), a.pbc,
+ invcell, a.pbc,
a.positions, cutoff, *args)
However, we need to think about this a bit more, as this leads to zero cell volume, and would screw up the division of box into cells within C neighbour list code.
$ python neigh_pbc_test.py
Traceback (most recent call last):
File "neigh_pbc_test.py", line 7, in <module>
ij = neighbour_list('ij', a, 2.0)
File "/Users/jameskermode/.julia/v0.5/Conda/deps/usr/lib/python2.7/site-packages/matscipy/neighbours.py", line 133, in neighbour_list
a.positions, cutoff, *args)
RuntimeError: Zero cell volume.
Following the recent changes to neighbour list, the following script gives a seg fault in ring_statistics.cpp
from io import StringIO
from ase.io import read
from matscipy.rings import ring_statistics
buf = StringIO("""216
Lattice="13.844138387203303 0.0 0.0 0.0 13.844138387203303 0.0 0.0 0.0 13.844138387203303" Properties=species:S:1:pos:R:3 i=20652 time=10326.0 E=-1034.0492541143 pbc="T T T"
Si 8.76146557 10.35390567 0.11347189
Si 14.21807936 -3.56114904 -0.88593487
Si 13.78922021 5.94338441 11.82531443
Si 12.69713705 13.90634767 2.46041116
Si 1.08192336 8.49992707 4.21266214
Si 0.85104850 15.67425259 -2.57860263
Si 0.90029713 11.07042506 2.95418491
Si 3.85024689 4.76283378 17.86188400
Si 18.40046490 5.15887197 8.66436327
Si 11.26875133 2.12060084 13.49887492
Si 1.58350468 7.26296547 -4.71806042
Si 11.72714598 13.27014891 7.13562216
Si 8.65246048 3.44641145 0.25553552
Si 14.75414206 12.56433673 10.19498937
Si 1.11314818 5.67063297 14.71348905
Si 3.50879963 6.72344126 5.79210860
Si 7.15740861 27.76073598 7.72284615
Si 17.32886564 13.15921380 16.04127017
Si 3.50713845 2.37602214 14.82677479
Si 4.30343667 20.72354649 13.13594112
Si 6.69704328 11.52083452 -1.91956095
Si -2.40183153 9.94217749 11.16083709
Si 10.02171540 11.12007019 4.66360210
Si -7.49232500 5.13573774 5.99220070
Si 6.05611820 2.21979659 -8.58519128
Si 18.43981661 9.93240975 3.62400319
Si 9.06641982 10.03139824 10.79427260
Si 0.95461271 -1.80327653 7.05737680
Si 3.41338430 11.66944108 4.95967107
Si 11.82535593 7.67923982 10.56286792
Si 5.14616660 9.71482023 -2.34012219
Si 1.33172638 13.51288996 18.07489084
Si 8.49579219 14.36337409 4.47234068
Si 3.24023788 8.91541882 8.53056834
Si 4.42194552 0.54113385 5.20728715
Si 15.21659049 5.66741936 7.46127358
Si -0.35217392 4.49012920 3.79097796
Si 1.85797522 3.00166706 -0.82181693
Si -0.21150422 0.86491245 0.33452660
Si 14.82585907 10.26862238 10.64942136
Si 2.64381855 9.49171038 5.66138329
Si 8.45336107 8.57503025 5.06476787
Si 11.64444759 5.11333178 12.38091823
Si 9.60337187 12.58303496 11.88682843
Si 10.31617897 -1.00846924 14.62796849
Si 1.56662794 19.51190920 17.19874186
Si -0.75752203 11.17122226 4.90210710
Si 5.07227242 -1.30346450 7.76358958
Si 3.70137830 2.14366207 -3.01185260
Si 9.81201525 14.59234686 9.71660334
Si 7.56831202 6.10514965 -0.96626846
Si 3.49447971 3.68380139 6.12331300
Si 13.70003808 17.44575169 14.40900401
Si 13.69119144 8.89082786 9.21911926
Si -3.96455740 8.12620160 13.27386301
Si 16.28305016 1.62515452 5.69090233
Si 9.90362611 1.81161098 1.81279522
Si 8.50402936 11.63259578 -4.82089379
Si 7.75468312 -1.24494168 5.67513360
Si 5.43998939 1.79327633 9.06885178
Si 13.39056313 11.89994920 15.18072883
Si 11.36662443 3.65567325 1.72066924
Si 6.08662600 -1.07598778 14.00262661
Si 19.16189952 3.20222647 3.34446769
Si 7.03257924 4.71795393 11.04650111
Si 9.50416713 4.48007738 17.69895700
Si 2.71834343 5.36789748 10.06432496
Si -5.29980247 3.14671596 6.37038110
Si 3.31451730 11.00785092 -2.79987168
Si 13.15128604 -3.29437878 7.34619020
Si 2.12814786 5.15268096 12.21819136
Si -3.31539847 -0.30916988 3.88095304
Si -3.09286206 2.07489432 6.79437799
Si -6.32218457 3.32560867 -5.31338461
Si 11.70747608 12.13939376 -0.96972644
Si -3.97829566 -2.88611492 7.22240020
Si 5.42858625 3.09318784 -0.13880866
Si -4.17191967 7.39415311 9.56554548
Si 12.22910580 15.33071186 11.52646443
Si 13.87161726 8.40075975 15.46264589
Si 11.31849242 2.97980766 4.84215808
Si 6.88733656 14.62711195 -3.05272237
Si 8.31248146 13.73763357 0.07153271
Si 4.73036163 6.04915661 -12.37994938
Si 2.79867330 -0.25444259 -0.87207953
Si 22.01886363 6.12424105 18.62582225
Si 2.25602784 7.55499189 14.22415021
Si 2.59484030 11.32966587 13.23637996
Si 9.52199645 0.32360410 7.41756349
Si 10.36879046 4.33604006 -3.28374888
Si 6.68668791 -5.79652636 13.64121673
Si 8.57236117 11.51077818 2.79621436
Si 20.07798189 13.16478867 -10.70674256
Si 6.80871478 6.14840219 8.16413641
Si 4.44134763 -0.72767454 10.50020625
Si -5.25228093 16.96115877 11.71737967
Si 6.11605549 -5.11008184 4.99605264
Si 6.94805641 5.41431254 2.08639903
Si 16.80987806 4.54258700 15.56436229
Si 11.58876696 10.43988916 2.15478721
Si 19.55826404 0.85594734 12.75366622
Si 25.39431017 11.76258123 9.64269490
Si 4.76953949 18.08335210 11.76039345
Si 8.27323368 8.33471120 16.49302591
Si 3.19605553 -2.51672444 -5.59885816
Si 3.95315019 9.90043974 14.46555609
Si 6.93544112 9.96748074 15.49468680
Si 12.73333674 0.62276106 8.98884265
C 7.89677204 2.30461601 4.65578985
C 8.49750911 11.09584776 12.27592240
C 9.56419282 5.94913299 1.28374584
C 0.65127716 14.88359615 6.44071844
C 1.91535742 -1.02746658 8.59185242
C 8.03644803 -0.44837897 16.70060629
C -2.24594733 11.49240238 7.84365386
C 8.22779961 0.74092159 15.62561222
C 11.15698934 7.57331021 6.74070261
C 14.68521762 4.07221753 8.31959331
C 5.63262540 3.46348173 8.01902147
C 6.45227980 -1.06491397 10.39268230
C 0.60022667 15.41860739 7.89377403
C 9.76897454 9.58147855 19.78932515
C 19.68718231 1.00048600 16.21748136
C 14.86929197 1.27655436 16.65256522
C -1.58899503 10.27582057 -0.99634815
C 12.81052562 13.09176273 5.52030120
C 4.97621036 8.76982236 -0.70673976
C 13.63286039 15.80260516 5.66809215
C 13.13815707 8.22645267 4.77414074
C 10.44142149 5.33975245 2.32219861
C 13.46401486 3.14419640 6.33364408
C -0.98802031 6.01962310 16.70658086
C 8.15548753 17.05072008 3.43213396
C 4.12266647 0.10142012 8.82340247
C 11.97292037 8.76901887 15.25345477
C 3.22077796 5.35354431 7.07381472
C 6.94793150 2.81611743 1.15139671
C 6.70555171 12.35945462 -4.86918518
C 1.25617581 0.79649181 15.23519088
C 10.26338679 7.10228303 7.80618439
C 11.17278478 7.52193269 15.64324782
C -2.69629703 3.07634269 9.37077460
C -5.62850075 7.75326751 12.18088955
C -4.49095083 5.49727500 9.46329030
C 4.07828004 14.37407040 11.83127458
C 3.77690879 8.42964144 6.61116531
C 11.22057784 20.82358522 12.51667185
C 7.11008912 7.94823634 8.39162535
C 5.18890260 10.67806397 15.82596289
C 1.78383411 3.87045670 9.38408800
C -1.54963492 7.79729362 -0.80175207
C 11.42353797 1.72111112 9.88729524
C 7.85884423 5.14050726 9.34074462
C 5.76938240 7.19717854 3.89611143
C 2.06774423 2.39395520 9.76427671
C 14.52819130 6.36903427 5.83486257
C 2.67995596 14.06469426 8.70151775
C 5.41901654 3.48030314 6.57674620
C -1.24043825 13.40954258 11.71632839
C 17.59969228 8.40746937 2.86658652
C 0.14853823 6.67876307 2.30130824
C -0.93713014 13.03664622 10.25784672
C 4.87044535 -1.24789769 5.65940948
C 12.81685494 15.49258925 4.45705455
C 4.56872298 1.72940103 2.55158805
C 9.91176538 11.08010207 1.44110396
C 5.80033612 8.32026095 7.90913635
C 11.17825324 3.40214580 8.04780354
C 10.26247718 5.75778273 8.18454953
C 11.76017011 9.03674858 -0.16164587
C 9.05832906 0.50190528 12.37133354
C 9.83923017 7.40885707 15.02691528
C 4.65993616 7.39682769 2.87190889
C 6.13111512 12.54446059 4.84069958
C 5.75936548 8.65345768 10.13901130
C 11.54061697 6.35781720 2.50385705
C 11.93500341 17.79577530 13.76108995
C 11.14269160 4.76487802 7.61085349
C 2.19626854 1.36831415 3.83735017
C 5.25755628 8.47931015 6.60332433
C -2.89020960 8.70051845 5.86084910
C 14.56056675 8.41518707 13.62204586
C 0.03209667 -0.03368247 12.54326608
C 0.33251605 3.00480579 7.58672012
C 12.15359295 6.59938305 6.33399396
C 1.76349729 20.61737189 4.90574275
C 9.93556847 12.67039588 10.02995869
C 8.25248265 8.27651942 10.74684014
C 7.02481273 17.43303227 2.48575753
C -3.00338828 0.14002654 15.91629341
C 2.75584796 8.76317703 1.79835916
C 0.41968560 13.43083022 5.92727688
C 7.10708884 6.77548467 3.32765936
C 11.88469855 8.92679585 4.77273132
C 5.18953132 12.20577839 1.82487614
C 3.63921442 14.67689728 3.38249656
C 13.49964800 1.77638987 16.86428289
C -0.23500989 7.45316231 12.92889259
C -0.55982406 7.04356206 5.56874006
C -1.56982850 14.05786461 4.46437973
C 11.97255038 5.18943331 6.50464686
C 16.29490583 11.16839718 6.41250105
C 12.64771783 4.16063749 5.64961194
C 1.23411956 -0.12958704 11.84226386
C 1.86933205 1.35745958 8.78276721
C 4.97947989 8.70167789 8.99323121
C 2.56009519 0.41806975 14.75208527
C 1.42640792 9.28969228 2.48276192
C 2.42912895 12.17932198 3.38118907
C 11.68675880 10.27150163 4.10547232
C 8.36779028 5.30351229 0.61626877
C 5.06785069 6.10480551 -9.05013437
C 7.07712740 8.28688650 9.84004648
C 13.09084320 3.19314444 16.32286183
C 6.93984751 1.44157691 1.65429719
C 8.64589104 1.29061544 -2.68293240
""")
a = read(buf, format='extxyz')
s = ring_statistics(a, cutoff=1.8)
Here's a backtrace:
Program received signal SIGSEGV, Segmentation fault.
0x00002aaabd90dec3 in find_shortest_distances (seed=seed@entry=0x7ffffffef9a0, neighbours=neighbours@entry=0xacc480, root=root@entry=0, dist=dist@entry=0xad0870)
at c/ring_statistics.cpp:65
65 int j = neighbours[ni];
Missing separate debuginfos, use: debuginfo-install glibc-2.17-307.el7.1.x86_64 keyutils-libs-1.5.8-3.el7.x86_64 krb5-libs-1.15.1-46.el7.x86_64 libcom_err-1.42.9-17.el7.x86_64 libselinux-2.5-15.el7.x86_64 nss-softokn-freebl-3.44.0-8.el7_7.x86_64 openssl-libs-1.0.2k-19.el7.x86_64 pcre-8.32-17.el7.x86_64
(gdb) bt
#0 0x00002aaabd90dec3 in find_shortest_distances (seed=seed@entry=0x7ffffffef9a0, neighbours=neighbours@entry=0xacc480, root=root@entry=0, dist=dist@entry=0xad0870)
at c/ring_statistics.cpp:65
#1 0x00002aaabd90e078 in distances_on_graph (nat=nat@entry=216, seed=seed@entry=0x7ffffffef9a0, neighbours=0xacc480, dist=0xad0870, diameter=diameter@entry=0x0)
at c/ring_statistics.cpp:102
#2 0x00002aaabd90e3ec in py_distances_on_graph (self=self@entry=0x2aaabd87b6b0, args=args@entry=0x2aaabd880a00) at c/ring_statistics.cpp:152
#3 0x00002aaaaae46db4 in _PyMethodDef_RawFastCallKeywords () at Objects/call.c:698
#4 0x00002aaaaae47050 in _PyCFunction_FastCallKeywords (func=0x2aaabd86cf50, args=args@entry=0x2aaaaabd35c8, nargs=<optimized out>, kwnames=kwnames@entry=0x0)
at Objects/call.c:734
#5 0x00002aaaaaea49ec in call_function (kwnames=0x0, oparg=<optimized out>, pp_stack=<synthetic pointer>) at Python/ceval.c:4568
#6 _PyEval_EvalFrameDefault () at Python/ceval.c:3093
#7 0x00002aaaaadfd471 in _PyEval_EvalCodeWithName () at Python/ceval.c:3930
#8 0x00002aaaaadfe483 in PyEval_EvalCodeEx () at Python/ceval.c:3959
#9 0x00002aaaaadfe4ab in PyEval_EvalCode (co=co@entry=0x2aaaaab894b0, globals=globals@entry=0x2aaaaabb9d70, locals=locals@entry=0x2aaaaabb9d70) at Python/ceval.c:524
#10 0x00002aaaaaf1c542 in run_mod () at Python/pythonrun.c:1035
#11 0x00002aaaaaf1dd67 in PyRun_FileExFlags () at Python/pythonrun.c:988
#12 0x00002aaaaaf1ff58 in PyRun_SimpleFileExFlags () at Python/pythonrun.c:429
#13 0x00002aaaaaf20109 in PyRun_AnyFileExFlags () at Python/pythonrun.c:84
#14 0x00002aaaaaf21eaa in pymain_run_file (p_cf=0x7fffffff015c, filename=<optimized out>, fp=0x4298d0) at Modules/main.c:427
#15 pymain_run_filename (cf=0x7fffffff015c, pymain=0x7fffffff0230) at Modules/main.c:1606
#16 pymain_run_python (pymain=0x7fffffff0230) at Modules/main.c:2867
#17 pymain_main () at Modules/main.c:3028
#18 0x00002aaaaaf220ce in _Py_UnixMain (argc=<optimized out>, argv=<optimized out>) at Modules/main.c:3063
#19 0x00002aaaabc2e555 in __libc_start_main () from /lib64/libc.so.6
#20 0x000000000040079e in _start ()
I've confirmed that reverting to commit acc20d3 gets rid of the seg fault, so it must be related to the changes in the neighbour list, but I haven't yet dug deep enough to figure out exactly what changed.
@pastewka or @chcltchunk, any idea what might be causing this? Did ring statistics make some assumptions about the neighbour list ordering which are no longer valid?
Hi guys,
when converting a Voigt strain to a 3x3 strain and back, I don't get the same results.
I think the diagonal entries in the definition below should be 1.0*e1 and so on instead of using the "+".
def Voigt_6_to_full_3x3_strain(strain_vector):
"""
Form a 3x3 strain matrix from a 6 component vector in Voigt notation
"""
e1, e2, e3, e4, e5, e6 = np.transpose(strain_vector)
return np.transpose([[1.0+e1, 0.5*e6, 0.5*e5],
[0.5*e6, 1.0+e2, 0.5*e4],
[0.5*e5, 0.5*e4, 1.0+e3]])
Following merge of #117 we need to update the installation instructions in the README
when I pip install matscipy with windows10 VS2019,errors occurred
ERROR: Failed building wheel for matscipy
Running setup.py clean for matscipy
Failed to build matscipy
Installing collected packages: matscipy
Running setup.py install for matscipy ... error
ERROR: Command errored out with exit status 1:
command: 'D:\program\Anaconda3\envs\tmp\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\ADMINI1\AppData\Local\Temp\pip-install-8ief1gm9\matscipy\setup.py'"'"'; file='"'"'C:\Users\ADMINI1\AppData\Local\Temp\pip-install-8ief1gm9\matscipy\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' install --record 'C:\Users\ADMINI1\AppData\Local\Temp\pip-record-l0hegtj0\install-record.txt' --single-version-externally-managed --compile --install-headers 'D:\program\Anaconda3\envs\tmp\Include\matscipy'1\AppData\Local\Temp\pip-install-8ief1gm9\matscipy
cwd: C:\Users\ADMINI
Complete output (146 lines):
running install
running build
running config_cc
unifing config_cc, config, build_clib, build_ext, build commands --compiler options
running config_fc
unifing config_fc, config, build_clib, build_ext, build commands --fcompiler options
running build_src
build_src
building extension "matscipy" sources
build_src: building npy-pkg config files
running build_py
creating build
creating build\lib.win-amd64-3.7
creating build\lib.win-amd64-3.7\matscipy
copying matscipy\angle_distribution.py -> build\lib.win-amd64-3.7\matscipy
copying matscipy\atomic_strain.py -> build\lib.win-amd64-3.7\matscipy
copying matscipy\deformation.py -> build\lib.win-amd64-3.7\matscipy
copying matscipy\dislocation.py -> build\lib.win-amd64-3.7\matscipy
copying matscipy\distributed_computation.py -> build\lib.win-amd64-3.7\matscipy
copying matscipy\drift.py -> build\lib.win-amd64-3.7\matscipy
copying matscipy\elasticity.py -> build\lib.win-amd64-3.7\matscipy
copying matscipy\hessian_finite_differences.py -> build\lib.win-amd64-3.7\matscipy
copying matscipy\hydrogenate.py -> build\lib.win-amd64-3.7\matscipy
copying matscipy\logger.py -> build\lib.win-amd64-3.7\matscipy
copying matscipy\neighbours.py -> build\lib.win-amd64-3.7\matscipy
copying matscipy\opls.py -> build\lib.win-amd64-3.7\matscipy
copying matscipy\pressurecoupling.py -> build\lib.win-amd64-3.7\matscipy
copying matscipy\rings.py -> build\lib.win-amd64-3.7\matscipy
copying matscipy\socketcalc.py -> build\lib.win-amd64-3.7\matscipy
copying matscipy\spatial_correlation_function.py -> build\lib.win-amd64-3.7\matscipy
copying matscipy\surface.py -> build\lib.win-amd64-3.7\matscipy
copying matscipy\visualise.py -> build\lib.win-amd64-3.7\matscipy
copying matscipy_version.py -> build\lib.win-amd64-3.7\matscipy
copying matscipy_init.py -> build\lib.win-amd64-3.7\matscipy
creating build\lib.win-amd64-3.7\matscipy\fracture_mechanics
copying matscipy\fracture_mechanics\clusters.py -> build\lib.win-amd64-3.7\matscipy\fracture_mechanics
copying matscipy\fracture_mechanics\crack.py -> build\lib.win-amd64-3.7\matscipy\fracture_mechanics
copying matscipy\fracture_mechanics\crackpathsel.py -> build\lib.win-amd64-3.7\matscipy\fracture_mechanics
copying matscipy\fracture_mechanics\energy_release.py -> build\lib.win-amd64-3.7\matscipy\fracture_mechanics
copying matscipy\fracture_mechanics\idealbrittlesolid.py -> build\lib.win-amd64-3.7\matscipy\fracture_mechanics
copying matscipy\fracture_mechanics_init_.py -> build\lib.win-amd64-3.7\matscipy\fracture_mechanics
creating build\lib.win-amd64-3.7\matscipy\contact_mechanics
copying matscipy\contact_mechanics\analysis.py -> build\lib.win-amd64-3.7\matscipy\contact_mechanics
copying matscipy\contact_mechanics\DMT.py -> build\lib.win-amd64-3.7\matscipy\contact_mechanics
copying matscipy\contact_mechanics\greens_function.py -> build\lib.win-amd64-3.7\matscipy\contact_mechanics
copying matscipy\contact_mechanics\Hertz.py -> build\lib.win-amd64-3.7\matscipy\contact_mechanics
copying matscipy\contact_mechanics\JKR.py -> build\lib.win-amd64-3.7\matscipy\contact_mechanics
copying matscipy\contact_mechanics_init_.py -> build\lib.win-amd64-3.7\matscipy\contact_mechanics
creating build\lib.win-amd64-3.7\matscipy\electrochemistry
copying matscipy\electrochemistry\continuous2discrete.py -> build\lib.win-amd64-3.7\matscipy\electrochemistry
copying matscipy\electrochemistry\poisson_boltzmann_distribution.py -> build\lib.win-amd64-3.7\matscipy\electrochemistry
copying matscipy\electrochemistry\poisson_nernst_planck_solver.py -> build\lib.win-amd64-3.7\matscipy\electrochemistry
copying matscipy\electrochemistry_init_.py -> build\lib.win-amd64-3.7\matscipy\electrochemistry
creating build\lib.win-amd64-3.7\matscipy\calculators
copying matscipy\calculators\fitting.py -> build\lib.win-amd64-3.7\matscipy\calculators
copying matscipy\calculators\supercell_calculator.py -> build\lib.win-amd64-3.7\matscipy\calculators
copying matscipy\calculators_init_.py -> build\lib.win-amd64-3.7\matscipy\calculators
creating build\lib.win-amd64-3.7\matscipy\calculators\eam
copying matscipy\calculators\eam\average_atom.py -> build\lib.win-amd64-3.7\matscipy\calculators\eam
copying matscipy\calculators\eam\calculator.py -> build\lib.win-amd64-3.7\matscipy\calculators\eam
copying matscipy\calculators\eam\io.py -> build\lib.win-amd64-3.7\matscipy\calculators\eam
copying matscipy\calculators\eam_init_.py -> build\lib.win-amd64-3.7\matscipy\calculators\eam
creating build\lib.win-amd64-3.7\matscipy\io
copying matscipy\io\metis.py -> build\lib.win-amd64-3.7\matscipy\io
copying matscipy\io\opls.py -> build\lib.win-amd64-3.7\matscipy\io
copying matscipy\io\tbl.py -> build\lib.win-amd64-3.7\matscipy\io
copying matscipy\io_init_.py -> build\lib.win-amd64-3.7\matscipy\io
creating build\lib.win-amd64-3.7\matscipy\tool
copying matscipy\tool\plot.py -> build\lib.win-amd64-3.7\matscipy\tool
copying matscipy\tool_init_.py -> build\lib.win-amd64-3.7\matscipy\tool
creating build\lib.win-amd64-3.7\matscipy\calculators\pair_potential
copying matscipy\calculators\pair_potential\calculator.py -> build\lib.win-amd64-3.7\matscipy\calculators\pair_potential
copying matscipy\calculators\pair_potential_init_.py -> build\lib.win-amd64-3.7\matscipy\calculators\pair_potential
creating build\lib.win-amd64-3.7\matscipy\calculators\polydisperse
copying matscipy\calculators\polydisperse\calculator.py -> build\lib.win-amd64-3.7\matscipy\calculators\polydisperse
copying matscipy\calculators\polydisperse_init_.py -> build\lib.win-amd64-3.7\matscipy\calculators\polydisperse
creating build\lib.win-amd64-3.7\matscipy\calculators\mcfm
copying matscipy\calculators\mcfm\calculator.py -> build\lib.win-amd64-3.7\matscipy\calculators\mcfm
copying matscipy\calculators\mcfm\cluster_data.py -> build\lib.win-amd64-3.7\matscipy\calculators\mcfm
copying matscipy\calculators\mcfm\qm_cluster.py -> build\lib.win-amd64-3.7\matscipy\calculators\mcfm
copying matscipy\calculators\mcfm_init_.py -> build\lib.win-amd64-3.7\matscipy\calculators\mcfm
creating build\lib.win-amd64-3.7\matscipy\calculators\mcfm\mcfm_parallel
copying matscipy\calculators\mcfm\mcfm_parallel\mcfm_parallel_control.py -> build\lib.win-amd64-3.7\matscipy\calculators\mcfm\mcfm_parallel
copying matscipy\calculators\mcfm\mcfm_parallel\mcfm_parallel_worker.py -> build\lib.win-amd64-3.7\matscipy\calculators\mcfm\mcfm_parallel
copying matscipy\calculators\mcfm\mcfm_parallel_init_.py -> build\lib.win-amd64-3.7\matscipy\calculators\mcfm\mcfm_parallel
creating build\lib.win-amd64-3.7\matscipy\calculators\mcfm\neighbour_list_mcfm
copying matscipy\calculators\mcfm\neighbour_list_mcfm\neighbour_list_base.py -> build\lib.win-amd64-3.7\matscipy\calculators\mcfm\neighbour_list_mcfm
copying matscipy\calculators\mcfm\neighbour_list_mcfm\neighbour_list_mcfm.py -> build\lib.win-amd64-3.7\matscipy\calculators\mcfm\neighbour_list_mcfm
copying matscipy\calculators\mcfm\neighbour_list_mcfm_init_.py -> build\lib.win-amd64-3.7\matscipy\calculators\mcfm\neighbour_list_mcfm
creating build\lib.win-amd64-3.7\matscipy\calculators\mcfm\qm_cluster_tools
copying matscipy\calculators\mcfm\qm_cluster_tools\base_qm_cluster_tool.py -> build\lib.win-amd64-3.7\matscipy\calculators\mcfm\qm_cluster_tools
copying matscipy\calculators\mcfm\qm_cluster_tools\qm_clustering_tool.py -> build\lib.win-amd64-3.7\matscipy\calculators\mcfm\qm_cluster_tools
copying matscipy\calculators\mcfm\qm_cluster_tools\qm_flagging_tool.py -> build\lib.win-amd64-3.7\matscipy\calculators\mcfm\qm_cluster_tools
copying matscipy\calculators\mcfm\qm_cluster_tools_init_.py -> build\lib.win-amd64-3.7\matscipy\calculators\mcfm\qm_cluster_tools
UPDATING build\lib.win-amd64-3.7\matscipy/_version.py
set build\lib.win-amd64-3.7\matscipy/_version.py to '0.6.0'
running build_ext
No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils
customize MSVCCompiler
customize MSVCCompiler using build_ext_subclass
No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils
customize MSVCCompiler
Missing compiler_cxx fix for MSVCCompiler
customize MSVCCompiler using build_ext_subclass
building 'matscipy' extension
Traceback (most recent call last):
File "", line 1, in
File "C:\Users\ADMINI~1\AppData\Local\Temp\pip-install-8ief1gm9\matscipy\setup.py", line 281, in
url="https://github.com/libAtoms/matscipy"
File "D:\program\Anaconda3\envs\tmp\lib\site-packages\numpy\distutils\core.py", line 171, in setup
return old_setup(**new_attr)
File "D:\program\Anaconda3\envs\tmp\lib\site-packages\setuptools_init.py", line 153, in setup
return distutils.core.setup(**attrs)
File "D:\program\Anaconda3\envs\tmp\lib\distutils\core.py", line 148, in setup
dist.run_commands()
File "D:\program\Anaconda3\envs\tmp\lib\distutils\dist.py", line 966, in run_commands
self.run_command(cmd)
File "D:\program\Anaconda3\envs\tmp\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "D:\program\Anaconda3\envs\tmp\lib\site-packages\numpy\distutils\command\install.py", line 62, in run
r = self.setuptools_run()
File "D:\program\Anaconda3\envs\tmp\lib\site-packages\numpy\distutils\command\install.py", line 36, in setuptools_run
return distutils_install.run(self)
File "D:\program\Anaconda3\envs\tmp\lib\distutils\command\install.py", line 545, in run
self.run_command('build')
File "D:\program\Anaconda3\envs\tmp\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "D:\program\Anaconda3\envs\tmp\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "D:\program\Anaconda3\envs\tmp\lib\site-packages\numpy\distutils\command\build.py", line 47, in run
old_build.run(self)
File "D:\program\Anaconda3\envs\tmp\lib\distutils\command\build.py", line 135, in run
self.run_command(cmd_name)
File "D:\program\Anaconda3\envs\tmp\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "D:\program\Anaconda3\envs\tmp\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "D:\program\Anaconda3\envs\tmp\lib\site-packages\numpy\distutils\command\build_ext.py", line 261, in run
self.build_extensions()
File "D:\program\Anaconda3\envs\tmp\lib\distutils\command\build_ext.py", line 449, in build_extensions
self._build_extensions_serial()
File "D:\program\Anaconda3\envs\tmp\lib\distutils\command\build_ext.py", line 474, in _build_extensions_serial
self.build_extension(ext)
File "C:\Users\ADMINI1\AppData\Local\Temp\pip-install-8ief1gm9\matscipy\setup.py", line 81, in build_extension1\AppData\Local\Temp\pip-install-8ief1gm9\matscipy\setup.py'"'"'; file='"'"'C:\Users\ADMINI
c = os.path.basename(self.compiler.compiler[0])
AttributeError: 'MSVCCompiler' object has no attribute 'compiler'
----------------------------------------
ERROR: Command errored out with exit status 1: 'D:\program\Anaconda3\envs\tmp\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\ADMINI1\AppData\Local\Temp\pip-install-8ief1gm9\matscipy\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' install --record 'C:\Users\ADMINI1\AppData\Local\Temp\pip-record-l0hegtj0\install-record.txt' --single-version-externally-managed --compile --install-headers 'D:\program\Anaconda3\envs\tmp\Include\matscipy' Check the logs for full command output.
push!(LOAD_PATH, "..")
using PyCall
using ASE
@pyimport matscipy.neighbours as matscipy_nlist
at = bulk("Al"; cubic=true)
at = repeat(at, (3, 3, 3))
@time NL = matscipy_nlist.neighbour_list("ijd", at.po, 3.1)
this returns neighbours as expected.
Changing to
at = bulk("Al"; cubic=false)
returns an empty neighbourlist.
(Int32[],Int32[],Float64[])
(also, it takes 6.8 second instead of 0.02 seconds)
Travis-CI.org is shutting down imminently and the payment plans on the replacement Travis-CI.com are exorbitant, with no free open source plan any more. I think we need to follow the rest of the open source world to GitHub actions - would that be ok? Happy to try to migrate the travis.yml, as I'm doing the same for QUIP and friends.
The following tests fail in CI:
Dear authors,
The provided paper is comprehensive and well-written. However, these comments may help improve it:
P.S. This issue is related to openjournals/joss-reviews#5668
Dear authors,
The software has standard and comprehensive automated tests implemented using pytest. However, these minor points can be taken into account in this regard:
test_angle_distribution.py .... [ 0%]
test_atomic_strain.py . [ 0%]
test_bop.py ............................................................................................................... [ 17%]
...... [ 18%]
test_bulk_properties.py ............. [ 20%]
test_c2d.py ...... [ 21%]
test_cauchy_born_corrector.py ........ [ 22%]
test_committee.py ............ [ 24%]
test_cubic_crystal_crack.py ...... [ 25%]
test_dislocation.py ssssssssssssss.sssssssss.ss.ssssssss.s [ 30%]
test_eam_average_atom.py .. [ 30%]
test_eam_calculator.py ....... [ 32%]
test_eam_calculator_forces_and_hessian.py ...... [ 32%]
test_eam_io.py .... [ 33%]
test_elastic_moduli.py .. [ 33%]
test_energy_release.py s [ 33%]
test_ewald.py ................................. [ 38%]
test_ffi.py . [ 39%]
test_full_to_Voigt.py .... [ 39%]
test_hessian_finite_differences.py ... [ 40%]
test_hessian_precon.py ... [ 40%]
test_hydrogenate.py . [ 40%]
test_idealbrittlesolid.py ... [ 41%]
test_invariants.py . [ 41%]
test_io.py ..... [ 42%]
test_mcfm.py ... [ 42%]
test_neighbours.py ................... [ 45%]
test_numpy_tricks.py . [ 45%]
test_opls.py ..... [ 46%]
test_opls_io.py ....... [ 47%]
test_pair_potential_calculator.py ...................... [ 50%]
test_poisson_nernst_planck_solver.py . [ 50%]
test_polydisperse_calculator.py ............ [ 52%]
test_pressurecoupling.py .... [ 53%]
test_ring_statistics.py ..... [ 53%]
test_rotation_of_elastic_constants.py . [ 54%]
test_spatial_correlation_function.py .. [ 54%]
test_supercell_calculator.py . [ 54%]
test_surface_reconstruction.py .. [ 54%]
manybody/test_manybody_molecules.py .........xxxxxxxxx [ 57%]
manybody/test_manybody_potentials.py x.x..x..x.......... [ 60%]
manybody/test_newmb.py XxXx.x............XXXX.X............XxXx.x............XXXX.X............XxXx.x............XXXX.X.... [ 75%]
........xxxx.x............xxxx.x............xxxx.x............xxxx.x............XxXx.x............XXXX.X............xxxx.x. [ 93%]
P.S. This issue is related to openjournals/joss-reviews#5668
I got the following segfault during the test, which it looks like it is cause by theneighbourlist?
julia(98489,0x7fff72062000) malloc: *** mach_vm_map(size=18446744072217231360) failed (error code=3)
*** error: can't allocate region
*** set a breakpoint in malloc_error_break to debug
julia(98489,0x7fff72062000) malloc: *** mach_vm_map(size=18446744072217231360) failed (error code=3)
*** error: can't allocate region
*** set a breakpoint in malloc_error_break to debug
signal (11): Segmentation fault: 11
while loading /Users/ortner/.julia/v0.5/JuLIP/test/testvarcell.jl, in expression starting on line 68
py_neighbour_list at /Users/ortner/anaconda/lib/python2.7/site-packages/_matscipy.so (unknown line)
This is reproducible: it happens when I put too much (negative??) pressure on a cell so that it breaks all bonds and the cell starts expanding without bounds. Here is the sequence of cell matrices before the segfault:
F = [0.0 4.05 4.05; 4.05 0.0 4.05; 4.05 4.05 0.0]
F = [-344.689 348.739 348.739; 348.739 -344.689 348.739; 348.739 348.739 -344.689]
F = [-1723.45 1727.5 1727.5; 1727.5 -1723.45 1727.5; 1727.5 1727.5 -1723.45]
F = [-8617.23 8621.28 8621.28; 8621.28 -8617.23 8621.28; 8621.28 8621.28 -8617.23]
Maybe you don't want to treat it as a bug at all, but I was just wondering whether a more gentle mode of failure (e.g. throw an exception) would be possible.
We should as a pyproject.toml
file and at least switch to declarative setuptools
build. My suggestion would be to additionally switch to Meson
as a build environment, see here: https://thiblahute.gitlab.io/mesonpep517/pyproject.html
I get a compile error related to the -std=c++0x
option (I think). Full output is below.
This is on OS X 10.10.5, Anaconda Python 2.3.0, andApple LLVM version 6.1.0 (clang-602.0.53) (based on LLVM 3.6.0svn)
Sunrise:matscipy ortner$ CC=gcc CXX=g++ python setup.py build
running build
running config_cc
unifing config_cc, config, build_clib, build_ext, build commands --compiler options
running config_fc
unifing config_fc, config, build_clib, build_ext, build commands --fcompiler options
running build_src
build_src
building extension "_matscipy" sources
build_src: building npy-pkg config files
running build_py
running build_ext
customize UnixCCompiler
customize UnixCCompiler using build_ext
customize UnixCCompiler
customize UnixCCompiler using build_ext
building '_matscipy' extension
compiling C sources
C compiler: gcc -fno-strict-aliasing -I/Users/ortner/anaconda/include -arch x86_64 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes
compile options: '-I/Users/ortner/anaconda/lib/python2.7/site-packages/numpy/core/include -I/Users/ortner/anaconda/include/python2.7 -c'
extra options: '-std=c++0x'
gcc: c/tools.c
error: invalid argument '-std=c++0x' not allowed with 'C/ObjC'
error: invalid argument '-std=c++0x' not allowed with 'C/ObjC'
error: Command "gcc -fno-strict-aliasing -I/Users/ortner/anaconda/include -arch x86_64 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Users/ortner/anaconda/lib/python2.7/site-packages/numpy/core/include -I/Users/ortner/anaconda/include/python2.7 -c c/tools.c -o build/temp.macosx-10.5-x86_64-2.7/c/tools.o -std=c++0x" failed with exit status 1
Hello,
I was searching for rings in compound AB2, and the only type of rings i need is (A-B)-(A-B)-(...). I modified functions step_colser(), step_away() and find_shortest_distances() with type[j] != type[j], but it say "Distance map and graph do not match". How can i do with it ?
Best regard,
yunai
For some reason writing and re-reading standard EAM files (kind="eam") fails.
In the function elastic_moduli()
, defined in elasticity.py
, a rotation of the vector u_b
(based on the function argument l
) into u_a = np.array([1, 0, 0])
is performed. That is, the argument vector is rotated into the x direction. A crucial bit here is the cross product
u_v = np.cross(u_a, u_b)
If I am not mistaken, a rotation starting with this operation corresponds to a rotation of u_a
into u_b
, i.e., a rotation of the x-vector into the chosen direction. Therefore, I believe it is correcter to write
u_v = np.cross(u_b, u_a)
or swap the definitions of u_a
and u_b
. I spotted there is an inconsistency with the Young's moduli as predicted by ELATE, if directions such as [101] and [-101] are not equivalent. So in many higher-symmetry systems this issue won't show up. Making the proposed changes makes the issue go away.
The current API to compute/get a hessian in matscipy is the following function:
def get_hessian(self,
atoms: ase.Atoms,
format: str = 'sparse',
divide_by_masses: bool = False) -> Union[scipy.sparse.spmatrix, np.ndarray]:
...
This has the following disatvantages:
MatscipyCalculator
by defining different properties for different parameter combinations (e.g. "dynamical_matrix"
calls with divide_by_masses=True
.bsr_matrix
for all calculators: this makes it harder to change for specific calculators in case it's sub-optimal, and makes us less interoperable with other codes or future calculators that might use a different format, e.g. hierarchical matrices, or matrix-free formulations (other kspace implementations, fast-multipole, etc.)"sparse"
and "neighbor-list"
, which are not interoperableTo solve these issues, I propose a new API:
def get_hessian(self,
atoms: ase.Atoms) -> scipy.sparse.linalg.LinearOperator:
...
The abstract class LinearOperator
is designed to abstract away details of how matrix-vector (or matrix-matrix) products are done and are fully composable, i.e. P = A * B
and S = A + B
can be defined for A
and B
that have different representation without needing conversion. They are also accepted as parameters to the sparse solve/diagonalization routines in scipy. Most calculators in matscipy would just need to call scipy.sparse.linalg.aslinearoperator()
on the sparse matrix that they assemble, which returns a concrete instance of MatrixLinearOperator
, from which the matrix representation can be retrieved, if need be (e.g. for tests). This addresses points 2 & 3 above.
For point 1, the divide by masses operation should be done in a separate function. For point 4, after discussing with @griessej , we figured that the neighbor-list format is only really used in the pair and polydisperse calculators for the calculation of the Born constants. It then makes sense to move whatever code in MatscipyCalculator
that uses that format to these calculators (and actually have the polydisperse calculator inherit from the pair calculator).
LMK what you think of this change. The main burden of making this change would probably be to change the tests of hessian values.
Hi,
In matscipy.dislocation.plot_vitek()
, the call to the atomman package function differential_displacement
provokes the following error :
TypeError: differential_displacement() got an unexpected keyword argument 'show'
with atomman version >1.2.4
.
Below, the call to atomman in matscipy :
am.defect.differential_displacement(base_system, disl_system,
burgers,
cutoff=neighborListCutoff,
xlim=plot_range[0],
ylim=plot_range[1],
zlim=plot_range[2],
plot_scale=plot_scale,
show=show, save_file=save_file,
plot_axes=plot_axes)
It is because we changed the arguments passed to the function to make it more general (see here).
The fix needs to account that differential_displacement
now returns a matplotlib figure object, that can be saved later directly in plot_vitek
.
When plot_vitek
is called in dislocation.show_NEB_configurations()
, there is a little change to make to be able to add new vitek plots on top of each other.
In the meantime, one can still use versions of atomman that are <=1.2.3
.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.