Closed yingxingcheng closed 5 years ago
PS: for ubuntu, there are no these problems.
PS: for window, it does work both for Python 2+ and Python 3+ as well.
Thanks for bringing this up. It can be fixed by configuring matplotlib to use the agg
backend. Can you try putting the following line in ~/.config/matplotlib/matplotlibrc
(can be created if needed):
backend: agg
Yes and no, the configuration directory you provided is not suited for my case, but I use the line below to find the configuration directory, and after this, it works! Many thanks.
First, one should obtain the correct matplotlib configuration directory:
>>> import matplotlib as mpl
>>> print(mpl.get_configdir())
>>> '/Users/yxcheng/.matplotlib'
Then, one should create a matplotlibrc
file if it doesn't exist and add the line backend : agg
:
echo 'backend : agg' >> /Users/yxcheng/.matplotlib/matplotlibrc
Finally, the output of python tinydft.py
is:
(tinydft) YingxingdeMacBook-Pro:tinydft yxcheng$ python tinydft.py
Electronic configuration 1s2 2s2 2p6 3s2 3p6 4s2 3d3
Occupation numbers per ang. mom. [[2.0, 2.0, 2.0, 2.0], [6.0, 6.0], [3.0]]
Nuclear charge 23
Number of electrons 23.0
Maximum ang. mol. quantum number 2
Number of radial grid points 512
Number of basis functions 40
Condition number of the overlap 3.0e-11
Pre-computing some integrals ...
Number of SCF iterations 25
Mixing parameter 0.500
It Total Rad Kin Ang Kin Hartree XC Ext
=== ============ ============ ============ ============ ============ ============
0 (guess)
1 -146.297775 1000.378965 1098.895851 641.130224 -58.824864 -2827.877951
2 -416.503845 815.664496 789.082941 504.264268 -48.480019 -2477.035532
3 -505.716805 746.517142 665.655353 430.078499 -43.233462 -2304.734337
4 -527.025823 727.102634 630.966259 401.225205 -41.337644 -2244.982276
5 -529.730362 723.928996 626.288455 395.595669 -40.995804 -2234.547679
6 -529.937654 723.427688 626.116295 394.867815 -40.962420 -2233.387033
7 -530.087844 723.156703 625.953212 394.481200 -40.945293 -2232.733666
8 -530.179460 723.027680 625.861019 394.367285 -40.940645 -2232.494799
9 -530.240590 722.955912 625.788023 394.311675 -40.937903 -2232.358296
10 -530.272505 722.921117 625.749141 394.291411 -40.936785 -2232.297389
11 -530.288290 722.904257 625.729162 394.282042 -40.936216 -2232.267534
12 -530.295408 722.896581 625.720171 394.278368 -40.935977 -2232.254550
13 -530.298546 722.893085 625.716188 394.276733 -40.935868 -2232.248685
14 -530.299874 722.891531 625.714528 394.276064 -40.935822 -2232.246174
15 -530.300430 722.890837 625.713842 394.275769 -40.935802 -2232.245076
16 -530.300659 722.890529 625.713568 394.275644 -40.935793 -2232.244606
17 -530.300752 722.890392 625.713459 394.275589 -40.935790 -2232.244402
18 -530.300790 722.890330 625.713418 394.275565 -40.935788 -2232.244314
19 -530.300805 722.890302 625.713402 394.275554 -40.935787 -2232.244275
20 -530.300811 722.890290 625.713396 394.275549 -40.935787 -2232.244258
21 -530.300814 722.890284 625.713393 394.275547 -40.935787 -2232.244251
22 -530.300815 722.890281 625.713393 394.275546 -40.935787 -2232.244247
23 -530.300815 722.890280 625.713392 394.275545 -40.935787 -2232.244246
24 -530.300816 722.890279 625.713392 394.275545 -40.935787 -2232.244245
This problem is fixed with matplotlib version 3.1.0 (or newer), which are available on pip and (recently) also on conda.
Hi Prof. Verstraelen:
There is an error when I run
python tinydft.py
in the Mac operating system, shown as follows:My Python environment is: