diff --git a/docs/images/README.md b/docs/images/README.md new file mode 100644 index 0000000..a103b55 --- /dev/null +++ b/docs/images/README.md @@ -0,0 +1,5 @@ +To create svg from fig: + +``` +fig2dev -L svg src/neighbors.fig neighbors.svg +``` \ No newline at end of file diff --git a/docs/images/neighbors.svg b/docs/images/neighbors.svg new file mode 100644 index 0000000..997dda2 --- /dev/null +++ b/docs/images/neighbors.svg @@ -0,0 +1,257 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +Unit cell + +Site 0 + +Site 1 + +Atom A + +Cell +0,+2, Site 0 + +Cell +0,+0, Site 1 + +Cell +1,+0, Site 1 + +Cell -2,-1, Site 1 + +Cell +2,-1, Site 0 + + diff --git a/docs/images/src/neighbors.fig b/docs/images/src/neighbors.fig new file mode 100644 index 0000000..c3d3d37 --- /dev/null +++ b/docs/images/src/neighbors.fig @@ -0,0 +1,85 @@ +#FIG 3.2 Produced by xfig version 3.2.6 +Landscape +Center +Inches +Letter +100.00 +Single +-2 +1200 2 +1 4 0 2 0 11 50 -1 20 0.000 1 0.0000 500 500 300 300 200 500 800 500 +1 4 0 2 0 11 50 -1 20 0.000 1 0.0000 500 3500 300 300 200 3500 800 3500 +1 4 0 2 0 11 50 -1 20 0.000 1 0.0000 500 6500 300 300 200 6500 800 6500 +1 4 0 2 0 11 50 -1 20 0.000 1 0.0000 500 9500 300 300 200 9500 800 9500 +1 4 0 2 0 11 50 -1 20 0.000 1 0.0000 3500 500 300 300 3200 500 3800 500 +1 4 0 2 0 11 50 -1 20 0.000 1 0.0000 3500 3500 300 300 3200 3500 3800 3500 +1 4 0 2 0 11 50 -1 20 0.000 1 0.0000 3500 6500 300 300 3200 6500 3800 6500 +1 4 0 2 0 11 50 -1 20 0.000 1 0.0000 3500 9500 300 300 3200 9500 3800 9500 +1 4 0 2 0 11 50 -1 20 0.000 1 0.0000 6500 500 300 300 6200 500 6800 500 +1 4 0 2 0 11 50 -1 20 0.000 1 0.0000 6500 3500 300 300 6200 3500 6800 3500 +1 4 0 2 0 11 50 -1 20 0.000 1 0.0000 6500 6500 300 300 6200 6500 6800 6500 +1 4 0 2 0 11 50 -1 20 0.000 1 0.0000 6500 9500 300 300 6200 9500 6800 9500 +1 4 0 2 0 11 50 -1 20 0.000 1 0.0000 9500 500 300 300 6200 500 6800 500 +1 4 0 2 0 11 50 -1 20 0.000 1 0.0000 9500 3500 300 300 6200 3500 6800 3500 +1 4 0 2 0 11 50 -1 20 0.000 1 0.0000 9500 6500 300 300 6200 6500 6800 6500 +1 4 0 2 0 11 50 -1 20 0.000 1 0.0000 9500 9500 300 300 6200 9500 6800 9500 +1 4 0 2 0 11 50 -1 20 0.000 1 0.0000 12500 500 300 300 12200 500 12800 500 +1 4 0 2 0 11 50 -1 20 0.000 1 0.0000 12500 3500 300 300 12200 3500 12800 3500 +1 4 0 2 0 11 50 -1 20 0.000 1 0.0000 12500 6500 300 300 12200 6500 12800 6500 +1 4 0 2 0 11 50 -1 20 0.000 1 0.0000 12500 9500 300 300 12200 9500 12800 9500 +1 4 0 2 0 14 50 -1 20 0.000 1 0.0000 2000 2000 400 400 1600 2000 2400 2000 +1 4 0 2 0 14 50 -1 20 0.000 1 0.0000 2000 5000 400 400 1600 5000 2400 5000 +1 4 0 2 0 14 50 -1 20 0.000 1 0.0000 2000 8000 400 400 1600 8000 2400 8000 +1 4 0 2 0 14 50 -1 20 0.000 1 0.0000 5000 2000 400 400 4600 2000 5400 2000 +1 4 0 2 0 14 50 -1 20 0.000 1 0.0000 5000 5000 400 400 4600 5000 5400 5000 +1 4 0 2 0 14 50 -1 20 0.000 1 0.0000 5000 8000 400 400 4600 8000 5400 8000 +1 4 0 2 0 14 50 -1 20 0.000 1 0.0000 8000 2000 400 400 7600 2000 8400 2000 +1 4 0 2 0 14 50 -1 20 0.000 1 0.0000 8000 5000 400 400 7600 5000 8400 5000 +1 4 0 2 0 14 50 -1 20 0.000 1 0.0000 8000 8000 400 400 7600 8000 8400 8000 +1 4 0 2 0 14 50 -1 20 0.000 1 0.0000 11000 2000 400 400 10600 2000 11400 2000 +1 4 0 2 0 14 50 -1 20 0.000 1 0.0000 11000 5000 400 400 10600 5000 11400 5000 +1 4 0 2 0 14 50 -1 20 0.000 1 0.0000 11000 8000 400 400 10600 8000 11400 8000 +2 2 0 1 0 0 51 -1 4 0.000 0 0 -1 0 0 5 + 500 500 3500 500 3500 3500 500 3500 500 500 +2 1 0 1 0 7 52 -1 -1 0.000 0 0 -1 0 0 2 + 500 500 12500 500 +2 1 0 1 0 7 52 -1 -1 0.000 0 0 -1 0 0 2 + 500 3500 12500 3500 +2 1 0 1 0 7 52 -1 -1 0.000 0 0 -1 0 0 2 + 500 6500 12500 6500 +2 1 0 1 0 7 52 -1 -1 0.000 0 0 -1 0 0 2 + 500 500 500 9500 +2 1 0 1 0 7 52 -1 -1 0.000 0 0 -1 0 0 2 + 3500 500 3500 9500 +2 1 0 1 0 7 52 -1 -1 0.000 0 0 -1 0 0 2 + 9500 500 9500 9500 +2 1 0 1 0 7 52 -1 -1 0.000 0 0 -1 0 0 2 + 12500 500 12500 9500 +2 1 0 1 0 7 52 -1 -1 0.000 0 0 -1 0 0 2 + 6500 500 6500 9500 +2 1 0 5 0 7 51 -1 -1 0.000 0 0 -1 1 0 2 + 1 1 6.00 120.00 240.00 + 6500 6500 6500 800 +2 1 0 5 0 7 51 -1 -1 0.000 0 0 -1 1 0 2 + 1 1 6.00 120.00 240.00 + 6500 6500 9200 6500 +2 1 0 5 0 7 51 -1 -1 0.000 0 0 -1 1 0 2 + 1 1 6.00 120.00 240.00 + 6500 6500 12232 9366 +2 1 0 5 0 7 51 -1 -1 0.000 0 0 -1 1 0 2 + 1 1 6.00 120.00 240.00 + 6500 6500 7750 5250 +2 1 0 5 0 7 51 -1 -1 0.000 0 0 -1 1 0 2 + 1 1 6.00 120.00 240.00 + 6500 6500 2400 7875 +2 1 0 1 0 7 52 -1 -1 0.000 0 0 -1 0 0 2 + 500 9500 12500 9500 +4 0 0 49 -1 16 22 0.0000 4 135 810 1000 1000 Unit cell\001 +4 0 0 49 -1 16 20 0.0000 4 135 540 750 3150 Site 0\001 +4 0 0 49 -1 16 20 0.0000 4 135 540 2500 2000 Site 1\001 +4 0 0 49 -1 16 20 0.0000 4 135 540 5250 6300 Atom A\001 +4 0 0 49 -1 16 14 0.0000 4 150 1620 6825 825 Cell +0,+2, Site 0\001 +4 0 0 49 -1 16 14 0.0000 4 150 1620 7350 4500 Cell +0,+0, Site 1\001 +4 0 0 49 -1 16 14 0.0000 4 150 1620 9825 6300 Cell +1,+0, Site 1\001 +4 0 0 49 -1 16 14 0.0000 4 150 1620 1275 7500 Cell -2,-1, Site 1\001 +4 0 0 49 -1 16 14 0.0000 4 150 1620 10425 9450 Cell +2,-1, Site 0\001 diff --git a/docs/tutorials.rst b/docs/tutorials.rst index 01cc228..37e4c82 100644 --- a/docs/tutorials.rst +++ b/docs/tutorials.rst @@ -8,3 +8,4 @@ Tutorials tutorials/discus tutorials/ase tutorials/diffpy + tutorials/neighbors diff --git a/docs/tutorials/neighbors.rst b/docs/tutorials/neighbors.rst new file mode 100644 index 0000000..e94571c --- /dev/null +++ b/docs/tutorials/neighbors.rst @@ -0,0 +1,29 @@ +================================== +Neighbors definition in Javelin +================================== + +.. image:: ../images/neighbors.svg + +The neighbors above are created in javelin by (starting at 12 o'clock +and working clockwise): + +>>> from javelin.neighborlist import NeighborList +>>> nl = NeighborList([[0, 0, 0, 2, 0], +... [0, 1, 0, 0, 0], +... [0, 0, 1, 0, 0], +... [0, 0, 2,-1, 0], +... [0, 1,-2,-1, 0]]) +>>> nl +NeighborList([[ 0 0 0 2 0] + [ 0 1 0 0 0] + [ 0 0 1 0 0] + [ 0 0 2 -1 0] + [ 0 1 -2 -1 0]]) +>>> print(nl) + | site | vector +index | origin target | i j k + 0 | 0 0 | 0 2 0 + 1 | 0 1 | 0 0 0 + 2 | 0 0 | 1 0 0 + 3 | 0 0 | 2 -1 0 + 4 | 0 1 | -2 -1 0