Skip to content

Commit

Permalink
Docs update
Browse files Browse the repository at this point in the history
  • Loading branch information
pulkin committed Dec 2, 2017
1 parent 1eab9ca commit 8743bf4
Show file tree
Hide file tree
Showing 10 changed files with 40 additions and 31 deletions.
4 changes: 2 additions & 2 deletions doc/dchf.rst
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,9 @@ The minimal distance is kept constant at 1.4A.
Case 3: Linear alkanes
======================

The benchmark model is :math:`\mathrm{C_6 H_{14}}` split into 6 clusters by default.
The benchmark model is :math:`\mathrm{C_{12} H_{26}}` split into ?? clusters by default.

.. image:: plots/alkane-8-domains.svg
.. image:: plots/alkane-12-domains.svg

The density matrix
------------------
Expand Down
12 changes: 9 additions & 3 deletions doc/plots/27-dchf-errors-locality-alkane.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,17 @@

tolerance = 1e-5

draw_cluster_model("alkane-8", width=800, height=200)
draw_cluster_model("alkane-12", width=800, height=200)

dchf = load_pyscf_cluster_model("alkane-8", isolated_cluster=True)
print "== 0 =="
dchf = load_pyscf_cluster_model("alkane-12")
dchf.__mol__.verbose = 4
dchf.kernel()
#
# print "== 1 =="
# del dchf.domains[1]
# dchf.add_domain([1, 2, 3, 4, 5, 6, 7, 8, 9], core=[4, 5, 6], insert_at=1)
# dchf.kernel()

hf = scf.RHF(dchf.__mol__)
hf.kernel()
Expand All @@ -31,7 +37,7 @@
(dchf, 122, "DC-HF"),
):
pyplot.subplot(subplot)
pyplot.imshow(abs(hf.dm if isinstance(hf, DCHF) else hf.make_rdm1()))
pyplot.imshow(abs(hf.dm if isinstance(hf, DCHF) else hf.make_rdm1()), vmin=0, vmax=2)
pyplot.title(title)
pyplot.colorbar()

Expand Down
16 changes: 0 additions & 16 deletions doc/plots/27-dchf-errors-locality-alkane_cached.py

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions doc/plots/alkane-12-domains.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion doc/plots/alkane-8-domains.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 6 additions & 1 deletion doc/plots/fake.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def p(x):


class LogCalls(object):
def __init__(self, name, head="", line_start="", tail=""):
def __init__(self, name, head="", line_start="", tail="", proto=None):
"""A simple facility logging all method calls."""
self.name = name
if os.path.exists(name):
Expand All @@ -20,9 +20,12 @@ def __init__(self, name, head="", line_start="", tail=""):
self.head = head
self.line_start = line_start
self.tail = tail
self.proto = proto

def __getattr__(self, item):
def __(*args, **kwargs):
if self.proto is not None:
getattr(self.proto, item)(*args, **kwargs)
self.items.append(
dict(
__method_name__=item,
Expand All @@ -47,6 +50,7 @@ def __(*args, **kwargs):


def pyplot(name=None):
from matplotlib import pyplot
if name is None:
name = inspect.stack()[1][1]
if name[-3:] == ".py":
Expand All @@ -57,4 +61,5 @@ def pyplot(name=None):
head="#/usr/bin/env python\n\"\"\"\nThis file was generated automatically.\n\"\"\"\nfrom matplotlib import pyplot",
line_start="pyplot.",
tail="\n",
proto=pyplot,
)
2 changes: 2 additions & 0 deletions doc/plots/graphite-cluster-10-domains.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions doc/plots/graphite-cluster-13-domains.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions doc/plots/graphite-cluster-6-domains.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
22 changes: 14 additions & 8 deletions doc/plots/models.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,21 @@
{"buffer": [2, 3, 11, 12, 6, 7, 15, 16, 17], "core": [4, 5, 13, 14]},
{"buffer": [4, 5, 13, 14], "core": [6, 7, 15, 16, 17]}]
},
"alkane-8": {
"pyscf-string": "H 4.42014622 4.16792406 3.37924476; C 5.29939098 3.54076487 3.37924476; H 5.29939098 2.91360568 4.25848952; H 5.29939098 2.91360568 2.50000000; C 6.45909854 4.36797623 3.37924476; H 6.45909854 4.99513542 4.25848952; H 6.45909854 4.99513542 2.50000000; C 7.61880609 3.54076487 3.37924476; H 7.61880609 2.91360568 4.25848952; H 7.61880609 2.91360568 2.50000000; C 8.77851365 4.36797623 3.37924476; H 8.77851365 4.99513542 4.25848952; H 8.77851365 4.99513542 2.50000000; C 9.93822121 3.54076487 3.37924476; H 9.93822121 2.91360568 4.25848952; H 9.93822121 2.91360568 2.50000000; C 11.09792876 4.36797623 3.37924476; H 11.09792876 4.99513542 4.25848952; H 11.09792876 4.99513542 2.50000000; H 11.97717352 3.74081704 3.37924476",
"alkane-12": {
"pyscf-string": "H 4.42014622 4.16792406 3.37924476; C 5.29939098 3.54076487 3.37924476; H 5.29939098 2.91360568 4.25848952; H 5.29939098 2.91360568 2.50000000; C 6.45909854 4.36797623 3.37924476; H 6.45909854 4.99513542 4.25848952; H 6.45909854 4.99513542 2.50000000; C 7.61880609 3.54076487 3.37924476; H 7.61880609 2.91360568 4.25848952; H 7.61880609 2.91360568 2.50000000; C 8.77851365 4.36797623 3.37924476; H 8.77851365 4.99513542 4.25848952; H 8.77851365 4.99513542 2.50000000; C 9.93822121 3.54076487 3.37924476; H 9.93822121 2.91360568 4.25848952; H 9.93822121 2.91360568 2.50000000; C 11.09792876 4.36797623 3.37924476; H 11.09792876 4.99513542 4.25848952; H 11.09792876 4.99513542 2.50000000; C 12.25763632 3.54076487 3.37924476; H 12.25763632 2.91360568 4.25848952; H 12.25763632 2.91360568 2.50000000; C 13.41734387 4.36797623 3.37924476; H 13.41734387 4.99513542 4.25848952; H 13.41734387 4.99513542 2.50000000; C 14.57705143 3.54076487 3.37924476; H 14.57705143 2.91360568 4.25848952; H 14.57705143 2.91360568 2.50000000; C 15.73675898 4.36797623 3.37924476; H 15.73675898 4.99513542 4.25848952; H 15.73675898 4.99513542 2.50000000; C 16.89646654 3.54076487 3.37924476; H 16.89646654 2.91360568 4.25848952; H 16.89646654 2.91360568 2.50000000; C 18.05617410 4.36797623 3.37924476; H 18.05617410 4.99513542 4.25848952; H 18.05617410 4.99513542 2.50000000; H 18.93541886 3.74081704 3.37924476",
"domains": [
{"core": [0, 1, 2, 3], "buffer":[4, 5, 6, 7, 8, 9]},
{"core": [4, 5, 6], "buffer":[0, 1, 2, 3, 7, 8, 9, 10, 11, 12]},
{"core": [7, 8, 9], "buffer":[0, 1, 2, 3, 4, 5, 6, 10, 11, 12, 13, 14, 15]},
{"core": [10, 11, 12], "buffer":[4, 5, 6, 7, 8, 9, 13, 14, 15, 16, 17, 18]},
{"core": [13, 14, 15], "buffer":[7, 8, 9, 10, 11, 12, 16, 17, 18, 19]},
{"core": [16, 17, 18, 19], "buffer":[10, 11, 12, 13, 14, 15]}
{"core": [0, 1, 2, 3], "buffer": []} ,
{"core": [4, 5, 6], "buffer": []} ,
{"core": [7, 8, 9], "buffer": []} ,
{"core": [10, 11, 12], "buffer": []} ,
{"core": [13, 14, 15], "buffer": []} ,
{"core": [16, 17, 18], "buffer": []} ,
{"core": [19, 20, 21], "buffer": []} ,
{"core": [22, 23, 24], "buffer": []} ,
{"core": [25, 26, 27], "buffer": []} ,
{"core": [28, 29, 30], "buffer": []} ,
{"core": [31, 32, 33], "buffer": []} ,
{"core": [34, 35, 36, 37], "buffer": []}
]
},
"graphite-cluster-6": {
Expand Down

0 comments on commit 8743bf4

Please sign in to comment.