From a755ed441e98c0df94d6e0e9e8c809979bcaca92 Mon Sep 17 00:00:00 2001 From: David Sehnal <david.sehnal@gmail.com> Date: Mon, 26 Oct 2020 15:37:52 +0100 Subject: [PATCH] alpha-orbitals: data model tweak --- README.md | 1 + src/examples/alpha-orbitals/example-data.ts | 304 +++++++++---------- src/extensions/alpha-orbitals/collocation.ts | 95 +++--- src/extensions/alpha-orbitals/cubes.ts | 6 +- src/extensions/alpha-orbitals/orbitals.ts | 2 + 5 files changed, 203 insertions(+), 205 deletions(-) diff --git a/README.md b/README.md index 75cf85d20..7721d1092 100644 --- a/README.md +++ b/README.md @@ -177,3 +177,4 @@ Funding sources include but are not limited to: * [RCSB PDB](https://www.rcsb.org) funding by a grant [DBI-1338415; PI: SK Burley] from the NSF, the NIH, and the US DoE * [PDBe, EMBL-EBI](https://pdbe.org) * [CEITEC](https://www.ceitec.eu/) +* [EntosAI](https://www.entos.ai) (``alpha-orbitals`` extension) diff --git a/src/examples/alpha-orbitals/example-data.ts b/src/examples/alpha-orbitals/example-data.ts index ff4a87270..2cf7c6071 100644 --- a/src/examples/alpha-orbitals/example-data.ts +++ b/src/examples/alpha-orbitals/example-data.ts @@ -175,7 +175,7 @@ export const DemoOrbitals = { ], 'shells': [ { - 'angularMomentum': 0, + 'angularMomentum': [0], 'coefficients': [ [ -0.004151277818987538, @@ -196,7 +196,7 @@ export const DemoOrbitals = { ] }, { - 'angularMomentum': 1, + 'angularMomentum': [1], 'coefficients': [ [ 0.007924233646294427, @@ -226,7 +226,7 @@ export const DemoOrbitals = { ], 'shells': [ { - 'angularMomentum': 0, + 'angularMomentum': [0], 'coefficients': [ [ -0.004151277818987536, @@ -247,7 +247,7 @@ export const DemoOrbitals = { ] }, { - 'angularMomentum': 1, + 'angularMomentum': [1], 'coefficients': [ [ 0.007924233646294425, @@ -277,7 +277,7 @@ export const DemoOrbitals = { ], 'shells': [ { - 'angularMomentum': 0, + 'angularMomentum': [0], 'coefficients': [ [ -0.004151277818987536, @@ -298,7 +298,7 @@ export const DemoOrbitals = { ] }, { - 'angularMomentum': 1, + 'angularMomentum': [1], 'coefficients': [ [ 0.007924233646294425, @@ -328,7 +328,7 @@ export const DemoOrbitals = { ], 'shells': [ { - 'angularMomentum': 0, + 'angularMomentum': [0], 'coefficients': [ [ -0.004151277818987536, @@ -349,7 +349,7 @@ export const DemoOrbitals = { ] }, { - 'angularMomentum': 1, + 'angularMomentum': [1], 'coefficients': [ [ 0.007924233646294425, @@ -379,7 +379,7 @@ export const DemoOrbitals = { ], 'shells': [ { - 'angularMomentum': 0, + 'angularMomentum': [0], 'coefficients': [ [ -0.004151277818987536, @@ -400,7 +400,7 @@ export const DemoOrbitals = { ] }, { - 'angularMomentum': 1, + 'angularMomentum': [1], 'coefficients': [ [ 0.007924233646294425, @@ -430,7 +430,7 @@ export const DemoOrbitals = { ], 'shells': [ { - 'angularMomentum': 0, + 'angularMomentum': [0], 'coefficients': [ [ -0.004151277818987536, @@ -451,7 +451,7 @@ export const DemoOrbitals = { ] }, { - 'angularMomentum': 1, + 'angularMomentum': [1], 'coefficients': [ [ 0.007924233646294425, @@ -481,7 +481,7 @@ export const DemoOrbitals = { ], 'shells': [ { - 'angularMomentum': 0, + 'angularMomentum': [0], 'coefficients': [ [ -0.004151277818987537, @@ -502,7 +502,7 @@ export const DemoOrbitals = { ] }, { - 'angularMomentum': 1, + 'angularMomentum': [1], 'coefficients': [ [ 0.007924233646294425, @@ -532,7 +532,7 @@ export const DemoOrbitals = { ], 'shells': [ { - 'angularMomentum': 0, + 'angularMomentum': [0], 'coefficients': [ [ -0.004151277818987537, @@ -553,7 +553,7 @@ export const DemoOrbitals = { ] }, { - 'angularMomentum': 1, + 'angularMomentum': [1], 'coefficients': [ [ 0.007924233646294425, @@ -583,7 +583,7 @@ export const DemoOrbitals = { ], 'shells': [ { - 'angularMomentum': 0, + 'angularMomentum': [0], 'coefficients': [ [ -0.004151277818987537, @@ -604,7 +604,7 @@ export const DemoOrbitals = { ] }, { - 'angularMomentum': 1, + 'angularMomentum': [1], 'coefficients': [ [ 0.007924233646294425, @@ -634,7 +634,7 @@ export const DemoOrbitals = { ], 'shells': [ { - 'angularMomentum': 0, + 'angularMomentum': [0], 'coefficients': [ [ -0.004151277818987537, @@ -655,7 +655,7 @@ export const DemoOrbitals = { ] }, { - 'angularMomentum': 1, + 'angularMomentum': [1], 'coefficients': [ [ 0.007924233646294425, @@ -685,7 +685,7 @@ export const DemoOrbitals = { ], 'shells': [ { - 'angularMomentum': 0, + 'angularMomentum': [0], 'coefficients': [ [ -0.004151277818987537, @@ -706,7 +706,7 @@ export const DemoOrbitals = { ] }, { - 'angularMomentum': 1, + 'angularMomentum': [1], 'coefficients': [ [ 0.007924233646294425, @@ -736,7 +736,7 @@ export const DemoOrbitals = { ], 'shells': [ { - 'angularMomentum': 0, + 'angularMomentum': [0], 'coefficients': [ [ -0.004151277818987537, @@ -757,7 +757,7 @@ export const DemoOrbitals = { ] }, { - 'angularMomentum': 1, + 'angularMomentum': [1], 'coefficients': [ [ 0.007924233646294425, @@ -787,7 +787,7 @@ export const DemoOrbitals = { ], 'shells': [ { - 'angularMomentum': 0, + 'angularMomentum': [0], 'coefficients': [ [ -0.004151277818987537, @@ -808,7 +808,7 @@ export const DemoOrbitals = { ] }, { - 'angularMomentum': 1, + 'angularMomentum': [1], 'coefficients': [ [ 0.007924233646294425, @@ -838,7 +838,7 @@ export const DemoOrbitals = { ], 'shells': [ { - 'angularMomentum': 0, + 'angularMomentum': [0], 'coefficients': [ [ -0.004151277818987537, @@ -859,7 +859,7 @@ export const DemoOrbitals = { ] }, { - 'angularMomentum': 1, + 'angularMomentum': [1], 'coefficients': [ [ 0.007924233646294425, @@ -889,7 +889,7 @@ export const DemoOrbitals = { ], 'shells': [ { - 'angularMomentum': 0, + 'angularMomentum': [0], 'coefficients': [ [ -0.004151277818987537, @@ -910,7 +910,7 @@ export const DemoOrbitals = { ] }, { - 'angularMomentum': 1, + 'angularMomentum': [1], 'coefficients': [ [ 0.007924233646294425, @@ -940,7 +940,7 @@ export const DemoOrbitals = { ], 'shells': [ { - 'angularMomentum': 0, + 'angularMomentum': [0], 'coefficients': [ [ -0.004151277818987537, @@ -961,7 +961,7 @@ export const DemoOrbitals = { ] }, { - 'angularMomentum': 1, + 'angularMomentum': [1], 'coefficients': [ [ 0.007924233646294425, @@ -991,7 +991,7 @@ export const DemoOrbitals = { ], 'shells': [ { - 'angularMomentum': 0, + 'angularMomentum': [0], 'coefficients': [ [ -0.004151277818987537, @@ -1012,7 +1012,7 @@ export const DemoOrbitals = { ] }, { - 'angularMomentum': 1, + 'angularMomentum': [1], 'coefficients': [ [ 0.007924233646294425, @@ -1042,7 +1042,7 @@ export const DemoOrbitals = { ], 'shells': [ { - 'angularMomentum': 0, + 'angularMomentum': [0], 'coefficients': [ [ -0.004151277818987537, @@ -1063,7 +1063,7 @@ export const DemoOrbitals = { ] }, { - 'angularMomentum': 1, + 'angularMomentum': [1], 'coefficients': [ [ 0.007924233646294425, @@ -1093,7 +1093,7 @@ export const DemoOrbitals = { ], 'shells': [ { - 'angularMomentum': 0, + 'angularMomentum': [0], 'coefficients': [ [ -0.004151277818987537, @@ -1114,7 +1114,7 @@ export const DemoOrbitals = { ] }, { - 'angularMomentum': 1, + 'angularMomentum': [1], 'coefficients': [ [ 0.007924233646294425, @@ -1144,7 +1144,7 @@ export const DemoOrbitals = { ], 'shells': [ { - 'angularMomentum': 0, + 'angularMomentum': [0], 'coefficients': [ [ -0.004151277818987537, @@ -1165,7 +1165,7 @@ export const DemoOrbitals = { ] }, { - 'angularMomentum': 1, + 'angularMomentum': [1], 'coefficients': [ [ 0.007924233646294425, @@ -1195,7 +1195,7 @@ export const DemoOrbitals = { ], 'shells': [ { - 'angularMomentum': 0, + 'angularMomentum': [0], 'coefficients': [ [ -0.004151277818987537, @@ -1216,7 +1216,7 @@ export const DemoOrbitals = { ] }, { - 'angularMomentum': 1, + 'angularMomentum': [1], 'coefficients': [ [ 0.007924233646294425, @@ -1246,7 +1246,7 @@ export const DemoOrbitals = { ], 'shells': [ { - 'angularMomentum': 0, + 'angularMomentum': [0], 'coefficients': [ [ -0.004151277818987537, @@ -1267,7 +1267,7 @@ export const DemoOrbitals = { ] }, { - 'angularMomentum': 1, + 'angularMomentum': [1], 'coefficients': [ [ 0.007924233646294425, @@ -1297,7 +1297,7 @@ export const DemoOrbitals = { ], 'shells': [ { - 'angularMomentum': 0, + 'angularMomentum': [0], 'coefficients': [ [ -0.004151277818987537, @@ -1318,7 +1318,7 @@ export const DemoOrbitals = { ] }, { - 'angularMomentum': 1, + 'angularMomentum': [1], 'coefficients': [ [ 0.007924233646294425, @@ -1348,7 +1348,7 @@ export const DemoOrbitals = { ], 'shells': [ { - 'angularMomentum': 0, + 'angularMomentum': [0], 'coefficients': [ [ -0.004151277818987537, @@ -1369,7 +1369,7 @@ export const DemoOrbitals = { ] }, { - 'angularMomentum': 1, + 'angularMomentum': [1], 'coefficients': [ [ 0.007924233646294425, @@ -1399,7 +1399,7 @@ export const DemoOrbitals = { ], 'shells': [ { - 'angularMomentum': 0, + 'angularMomentum': [0], 'coefficients': [ [ -0.004151277818987537, @@ -1420,7 +1420,7 @@ export const DemoOrbitals = { ] }, { - 'angularMomentum': 1, + 'angularMomentum': [1], 'coefficients': [ [ 0.007924233646294425, @@ -1450,7 +1450,7 @@ export const DemoOrbitals = { ], 'shells': [ { - 'angularMomentum': 0, + 'angularMomentum': [0], 'coefficients': [ [ -0.004151277818987537, @@ -1471,7 +1471,7 @@ export const DemoOrbitals = { ] }, { - 'angularMomentum': 1, + 'angularMomentum': [1], 'coefficients': [ [ 0.007924233646294425, @@ -1501,7 +1501,7 @@ export const DemoOrbitals = { ], 'shells': [ { - 'angularMomentum': 0, + 'angularMomentum': [0], 'coefficients': [ [ -0.004151277818987537, @@ -1522,7 +1522,7 @@ export const DemoOrbitals = { ] }, { - 'angularMomentum': 1, + 'angularMomentum': [1], 'coefficients': [ [ 0.007924233646294425, @@ -1552,7 +1552,7 @@ export const DemoOrbitals = { ], 'shells': [ { - 'angularMomentum': 0, + 'angularMomentum': [0], 'coefficients': [ [ -0.004151277818987537, @@ -1573,7 +1573,7 @@ export const DemoOrbitals = { ] }, { - 'angularMomentum': 1, + 'angularMomentum': [1], 'coefficients': [ [ 0.007924233646294425, @@ -1603,7 +1603,7 @@ export const DemoOrbitals = { ], 'shells': [ { - 'angularMomentum': 0, + 'angularMomentum': [0], 'coefficients': [ [ -0.004151277818987537, @@ -1624,7 +1624,7 @@ export const DemoOrbitals = { ] }, { - 'angularMomentum': 1, + 'angularMomentum': [1], 'coefficients': [ [ 0.007924233646294425, @@ -1654,7 +1654,7 @@ export const DemoOrbitals = { ], 'shells': [ { - 'angularMomentum': 0, + 'angularMomentum': [0], 'coefficients': [ [ -0.004151277818987537, @@ -1675,7 +1675,7 @@ export const DemoOrbitals = { ] }, { - 'angularMomentum': 1, + 'angularMomentum': [1], 'coefficients': [ [ 0.007924233646294425, @@ -1705,7 +1705,7 @@ export const DemoOrbitals = { ], 'shells': [ { - 'angularMomentum': 0, + 'angularMomentum': [0], 'coefficients': [ [ -0.004151277818987537, @@ -1726,7 +1726,7 @@ export const DemoOrbitals = { ] }, { - 'angularMomentum': 1, + 'angularMomentum': [1], 'coefficients': [ [ 0.007924233646294425, @@ -1756,7 +1756,7 @@ export const DemoOrbitals = { ], 'shells': [ { - 'angularMomentum': 0, + 'angularMomentum': [0], 'coefficients': [ [ -0.004151277818987537, @@ -1777,7 +1777,7 @@ export const DemoOrbitals = { ] }, { - 'angularMomentum': 1, + 'angularMomentum': [1], 'coefficients': [ [ 0.007924233646294425, @@ -1807,7 +1807,7 @@ export const DemoOrbitals = { ], 'shells': [ { - 'angularMomentum': 0, + 'angularMomentum': [0], 'coefficients': [ [ -0.004151277818987537, @@ -1828,7 +1828,7 @@ export const DemoOrbitals = { ] }, { - 'angularMomentum': 1, + 'angularMomentum': [1], 'coefficients': [ [ 0.007924233646294425, @@ -1858,7 +1858,7 @@ export const DemoOrbitals = { ], 'shells': [ { - 'angularMomentum': 0, + 'angularMomentum': [0], 'coefficients': [ [ -0.004151277818987537, @@ -1879,7 +1879,7 @@ export const DemoOrbitals = { ] }, { - 'angularMomentum': 1, + 'angularMomentum': [1], 'coefficients': [ [ 0.007924233646294425, @@ -1909,7 +1909,7 @@ export const DemoOrbitals = { ], 'shells': [ { - 'angularMomentum': 0, + 'angularMomentum': [0], 'coefficients': [ [ -0.004151277818987537, @@ -1930,7 +1930,7 @@ export const DemoOrbitals = { ] }, { - 'angularMomentum': 1, + 'angularMomentum': [1], 'coefficients': [ [ 0.007924233646294425, @@ -1960,7 +1960,7 @@ export const DemoOrbitals = { ], 'shells': [ { - 'angularMomentum': 0, + 'angularMomentum': [0], 'coefficients': [ [ -0.004151277818987537, @@ -1981,7 +1981,7 @@ export const DemoOrbitals = { ] }, { - 'angularMomentum': 1, + 'angularMomentum': [1], 'coefficients': [ [ 0.007924233646294425, @@ -2011,7 +2011,7 @@ export const DemoOrbitals = { ], 'shells': [ { - 'angularMomentum': 0, + 'angularMomentum': [0], 'coefficients': [ [ -0.004151277818987537, @@ -2032,7 +2032,7 @@ export const DemoOrbitals = { ] }, { - 'angularMomentum': 1, + 'angularMomentum': [1], 'coefficients': [ [ 0.007924233646294425, @@ -2062,7 +2062,7 @@ export const DemoOrbitals = { ], 'shells': [ { - 'angularMomentum': 0, + 'angularMomentum': [0], 'coefficients': [ [ -0.004151277818987537, @@ -2083,7 +2083,7 @@ export const DemoOrbitals = { ] }, { - 'angularMomentum': 1, + 'angularMomentum': [1], 'coefficients': [ [ 0.007924233646294425, @@ -2113,7 +2113,7 @@ export const DemoOrbitals = { ], 'shells': [ { - 'angularMomentum': 0, + 'angularMomentum': [0], 'coefficients': [ [ -0.004151277818987537, @@ -2134,7 +2134,7 @@ export const DemoOrbitals = { ] }, { - 'angularMomentum': 1, + 'angularMomentum': [1], 'coefficients': [ [ 0.007924233646294425, @@ -2164,7 +2164,7 @@ export const DemoOrbitals = { ], 'shells': [ { - 'angularMomentum': 0, + 'angularMomentum': [0], 'coefficients': [ [ -0.004151277818987537, @@ -2185,7 +2185,7 @@ export const DemoOrbitals = { ] }, { - 'angularMomentum': 1, + 'angularMomentum': [1], 'coefficients': [ [ 0.007924233646294425, @@ -2215,7 +2215,7 @@ export const DemoOrbitals = { ], 'shells': [ { - 'angularMomentum': 0, + 'angularMomentum': [0], 'coefficients': [ [ -0.004151277818987537, @@ -2236,7 +2236,7 @@ export const DemoOrbitals = { ] }, { - 'angularMomentum': 1, + 'angularMomentum': [1], 'coefficients': [ [ 0.007924233646294425, @@ -2266,7 +2266,7 @@ export const DemoOrbitals = { ], 'shells': [ { - 'angularMomentum': 0, + 'angularMomentum': [0], 'coefficients': [ [ 0.009163596280542963, @@ -2287,7 +2287,7 @@ export const DemoOrbitals = { ] }, { - 'angularMomentum': 0, + 'angularMomentum': [0], 'coefficients': [ [ -0.32279868167000036, @@ -2323,7 +2323,7 @@ export const DemoOrbitals = { ], 'shells': [ { - 'angularMomentum': 0, + 'angularMomentum': [0], 'coefficients': [ [ 0.009163596280542963, @@ -2344,7 +2344,7 @@ export const DemoOrbitals = { ] }, { - 'angularMomentum': 0, + 'angularMomentum': [0], 'coefficients': [ [ -0.32279868167000036, @@ -2380,7 +2380,7 @@ export const DemoOrbitals = { ], 'shells': [ { - 'angularMomentum': 0, + 'angularMomentum': [0], 'coefficients': [ [ 0.009163596280542963, @@ -2401,7 +2401,7 @@ export const DemoOrbitals = { ] }, { - 'angularMomentum': 0, + 'angularMomentum': [0], 'coefficients': [ [ -0.32279868167000036, @@ -2437,7 +2437,7 @@ export const DemoOrbitals = { ], 'shells': [ { - 'angularMomentum': 0, + 'angularMomentum': [0], 'coefficients': [ [ 0.009163596280542963, @@ -2458,7 +2458,7 @@ export const DemoOrbitals = { ] }, { - 'angularMomentum': 0, + 'angularMomentum': [0], 'coefficients': [ [ -0.32279868167000036, @@ -2494,7 +2494,7 @@ export const DemoOrbitals = { ], 'shells': [ { - 'angularMomentum': 0, + 'angularMomentum': [0], 'coefficients': [ [ 0.009163596280542963, @@ -2515,7 +2515,7 @@ export const DemoOrbitals = { ] }, { - 'angularMomentum': 0, + 'angularMomentum': [0], 'coefficients': [ [ -0.32279868167000036, @@ -2551,7 +2551,7 @@ export const DemoOrbitals = { ], 'shells': [ { - 'angularMomentum': 0, + 'angularMomentum': [0], 'coefficients': [ [ 0.009163596280542963, @@ -2572,7 +2572,7 @@ export const DemoOrbitals = { ] }, { - 'angularMomentum': 0, + 'angularMomentum': [0], 'coefficients': [ [ -0.32279868167000036, @@ -2608,7 +2608,7 @@ export const DemoOrbitals = { ], 'shells': [ { - 'angularMomentum': 0, + 'angularMomentum': [0], 'coefficients': [ [ 0.009163596280542963, @@ -2629,7 +2629,7 @@ export const DemoOrbitals = { ] }, { - 'angularMomentum': 0, + 'angularMomentum': [0], 'coefficients': [ [ -0.32279868167000036, @@ -2665,7 +2665,7 @@ export const DemoOrbitals = { ], 'shells': [ { - 'angularMomentum': 0, + 'angularMomentum': [0], 'coefficients': [ [ 0.009163596280542963, @@ -2686,7 +2686,7 @@ export const DemoOrbitals = { ] }, { - 'angularMomentum': 0, + 'angularMomentum': [0], 'coefficients': [ [ -0.32279868167000036, @@ -2722,7 +2722,7 @@ export const DemoOrbitals = { ], 'shells': [ { - 'angularMomentum': 0, + 'angularMomentum': [0], 'coefficients': [ [ 0.009163596280542963, @@ -2743,7 +2743,7 @@ export const DemoOrbitals = { ] }, { - 'angularMomentum': 0, + 'angularMomentum': [0], 'coefficients': [ [ -0.32279868167000036, @@ -2779,7 +2779,7 @@ export const DemoOrbitals = { ], 'shells': [ { - 'angularMomentum': 0, + 'angularMomentum': [0], 'coefficients': [ [ 0.009163596280542963, @@ -2800,7 +2800,7 @@ export const DemoOrbitals = { ] }, { - 'angularMomentum': 0, + 'angularMomentum': [0], 'coefficients': [ [ -0.32279868167000036, @@ -2836,7 +2836,7 @@ export const DemoOrbitals = { ], 'shells': [ { - 'angularMomentum': 0, + 'angularMomentum': [0], 'coefficients': [ [ 0.009163596280542963, @@ -2857,7 +2857,7 @@ export const DemoOrbitals = { ] }, { - 'angularMomentum': 0, + 'angularMomentum': [0], 'coefficients': [ [ -0.32279868167000036, @@ -2893,7 +2893,7 @@ export const DemoOrbitals = { ], 'shells': [ { - 'angularMomentum': 0, + 'angularMomentum': [0], 'coefficients': [ [ 0.009163596280542963, @@ -2914,7 +2914,7 @@ export const DemoOrbitals = { ] }, { - 'angularMomentum': 0, + 'angularMomentum': [0], 'coefficients': [ [ -0.32279868167000036, @@ -2950,7 +2950,7 @@ export const DemoOrbitals = { ], 'shells': [ { - 'angularMomentum': 0, + 'angularMomentum': [0], 'coefficients': [ [ 0.009163596280542963, @@ -2971,7 +2971,7 @@ export const DemoOrbitals = { ] }, { - 'angularMomentum': 0, + 'angularMomentum': [0], 'coefficients': [ [ -0.32279868167000036, @@ -3007,7 +3007,7 @@ export const DemoOrbitals = { ], 'shells': [ { - 'angularMomentum': 0, + 'angularMomentum': [0], 'coefficients': [ [ 0.009163596280542963, @@ -3028,7 +3028,7 @@ export const DemoOrbitals = { ] }, { - 'angularMomentum': 0, + 'angularMomentum': [0], 'coefficients': [ [ -0.32279868167000036, @@ -3064,7 +3064,7 @@ export const DemoOrbitals = { ], 'shells': [ { - 'angularMomentum': 0, + 'angularMomentum': [0], 'coefficients': [ [ 0.009163596280542963, @@ -3085,7 +3085,7 @@ export const DemoOrbitals = { ] }, { - 'angularMomentum': 0, + 'angularMomentum': [0], 'coefficients': [ [ -0.32279868167000036, @@ -3121,7 +3121,7 @@ export const DemoOrbitals = { ], 'shells': [ { - 'angularMomentum': 0, + 'angularMomentum': [0], 'coefficients': [ [ 0.009163596280542963, @@ -3142,7 +3142,7 @@ export const DemoOrbitals = { ] }, { - 'angularMomentum': 0, + 'angularMomentum': [0], 'coefficients': [ [ -0.32279868167000036, @@ -3178,7 +3178,7 @@ export const DemoOrbitals = { ], 'shells': [ { - 'angularMomentum': 0, + 'angularMomentum': [0], 'coefficients': [ [ 0.009163596280542963, @@ -3199,7 +3199,7 @@ export const DemoOrbitals = { ] }, { - 'angularMomentum': 0, + 'angularMomentum': [0], 'coefficients': [ [ -0.32279868167000036, @@ -3235,7 +3235,7 @@ export const DemoOrbitals = { ], 'shells': [ { - 'angularMomentum': 0, + 'angularMomentum': [0], 'coefficients': [ [ 0.009163596280542963, @@ -3256,7 +3256,7 @@ export const DemoOrbitals = { ] }, { - 'angularMomentum': 0, + 'angularMomentum': [0], 'coefficients': [ [ -0.32279868167000036, @@ -3292,7 +3292,7 @@ export const DemoOrbitals = { ], 'shells': [ { - 'angularMomentum': 0, + 'angularMomentum': [0], 'coefficients': [ [ 0.009163596280542963, @@ -3313,7 +3313,7 @@ export const DemoOrbitals = { ] }, { - 'angularMomentum': 0, + 'angularMomentum': [0], 'coefficients': [ [ -0.32279868167000036, @@ -3349,7 +3349,7 @@ export const DemoOrbitals = { ], 'shells': [ { - 'angularMomentum': 0, + 'angularMomentum': [0], 'coefficients': [ [ 0.009163596280542963, @@ -3370,7 +3370,7 @@ export const DemoOrbitals = { ] }, { - 'angularMomentum': 0, + 'angularMomentum': [0], 'coefficients': [ [ -0.32279868167000036, @@ -3406,7 +3406,7 @@ export const DemoOrbitals = { ], 'shells': [ { - 'angularMomentum': 0, + 'angularMomentum': [0], 'coefficients': [ [ 0.009163596280542963, @@ -3427,7 +3427,7 @@ export const DemoOrbitals = { ] }, { - 'angularMomentum': 0, + 'angularMomentum': [0], 'coefficients': [ [ -0.32279868167000036, @@ -3463,7 +3463,7 @@ export const DemoOrbitals = { ], 'shells': [ { - 'angularMomentum': 0, + 'angularMomentum': [0], 'coefficients': [ [ 0.009163596280542963, @@ -3484,7 +3484,7 @@ export const DemoOrbitals = { ] }, { - 'angularMomentum': 0, + 'angularMomentum': [0], 'coefficients': [ [ -0.32279868167000036, @@ -3520,7 +3520,7 @@ export const DemoOrbitals = { ], 'shells': [ { - 'angularMomentum': 0, + 'angularMomentum': [0], 'coefficients': [ [ 0.009163596280542963, @@ -3541,7 +3541,7 @@ export const DemoOrbitals = { ] }, { - 'angularMomentum': 0, + 'angularMomentum': [0], 'coefficients': [ [ -0.32279868167000036, @@ -3577,7 +3577,7 @@ export const DemoOrbitals = { ], 'shells': [ { - 'angularMomentum': 0, + 'angularMomentum': [0], 'coefficients': [ [ 0.009163596280542963, @@ -3598,7 +3598,7 @@ export const DemoOrbitals = { ] }, { - 'angularMomentum': 0, + 'angularMomentum': [0], 'coefficients': [ [ -0.32279868167000036, @@ -3634,7 +3634,7 @@ export const DemoOrbitals = { ], 'shells': [ { - 'angularMomentum': 0, + 'angularMomentum': [0], 'coefficients': [ [ 0.009163596280542963, @@ -3655,7 +3655,7 @@ export const DemoOrbitals = { ] }, { - 'angularMomentum': 0, + 'angularMomentum': [0], 'coefficients': [ [ -0.32279868167000036, @@ -3691,7 +3691,7 @@ export const DemoOrbitals = { ], 'shells': [ { - 'angularMomentum': 0, + 'angularMomentum': [0], 'coefficients': [ [ 0.009163596280542963, @@ -3712,7 +3712,7 @@ export const DemoOrbitals = { ] }, { - 'angularMomentum': 0, + 'angularMomentum': [0], 'coefficients': [ [ -0.32279868167000036, @@ -3748,7 +3748,7 @@ export const DemoOrbitals = { ], 'shells': [ { - 'angularMomentum': 0, + 'angularMomentum': [0], 'coefficients': [ [ 0.009163596280542963, @@ -3769,7 +3769,7 @@ export const DemoOrbitals = { ] }, { - 'angularMomentum': 0, + 'angularMomentum': [0], 'coefficients': [ [ -0.32279868167000036, @@ -3805,7 +3805,7 @@ export const DemoOrbitals = { ], 'shells': [ { - 'angularMomentum': 0, + 'angularMomentum': [0], 'coefficients': [ [ 0.009163596280542963, @@ -3826,7 +3826,7 @@ export const DemoOrbitals = { ] }, { - 'angularMomentum': 0, + 'angularMomentum': [0], 'coefficients': [ [ -0.32279868167000036, @@ -3862,7 +3862,7 @@ export const DemoOrbitals = { ], 'shells': [ { - 'angularMomentum': 0, + 'angularMomentum': [0], 'coefficients': [ [ 0.009163596280542963, @@ -3883,7 +3883,7 @@ export const DemoOrbitals = { ] }, { - 'angularMomentum': 0, + 'angularMomentum': [0], 'coefficients': [ [ -0.32279868167000036, @@ -3919,7 +3919,7 @@ export const DemoOrbitals = { ], 'shells': [ { - 'angularMomentum': 0, + 'angularMomentum': [0], 'coefficients': [ [ 0.009163596280542963, @@ -3940,7 +3940,7 @@ export const DemoOrbitals = { ] }, { - 'angularMomentum': 0, + 'angularMomentum': [0], 'coefficients': [ [ -0.32279868167000036, @@ -3976,7 +3976,7 @@ export const DemoOrbitals = { ], 'shells': [ { - 'angularMomentum': 0, + 'angularMomentum': [0], 'coefficients': [ [ 0.009163596280542963, @@ -3997,7 +3997,7 @@ export const DemoOrbitals = { ] }, { - 'angularMomentum': 0, + 'angularMomentum': [0], 'coefficients': [ [ -0.32279868167000036, @@ -4033,7 +4033,7 @@ export const DemoOrbitals = { ], 'shells': [ { - 'angularMomentum': 0, + 'angularMomentum': [0], 'coefficients': [ [ 0.009163596280542963, @@ -4054,7 +4054,7 @@ export const DemoOrbitals = { ] }, { - 'angularMomentum': 0, + 'angularMomentum': [0], 'coefficients': [ [ -0.32279868167000036, @@ -4090,7 +4090,7 @@ export const DemoOrbitals = { ], 'shells': [ { - 'angularMomentum': 0, + 'angularMomentum': [0], 'coefficients': [ [ 0.009163596280542963, @@ -4111,7 +4111,7 @@ export const DemoOrbitals = { ] }, { - 'angularMomentum': 0, + 'angularMomentum': [0], 'coefficients': [ [ -0.32279868167000036, @@ -4147,7 +4147,7 @@ export const DemoOrbitals = { ], 'shells': [ { - 'angularMomentum': 0, + 'angularMomentum': [0], 'coefficients': [ [ 0.009163596280542963, @@ -4168,7 +4168,7 @@ export const DemoOrbitals = { ] }, { - 'angularMomentum': 0, + 'angularMomentum': [0], 'coefficients': [ [ -0.32279868167000036, @@ -4204,7 +4204,7 @@ export const DemoOrbitals = { ], 'shells': [ { - 'angularMomentum': 0, + 'angularMomentum': [0], 'coefficients': [ [ 0.009163596280542963, @@ -4225,7 +4225,7 @@ export const DemoOrbitals = { ] }, { - 'angularMomentum': 0, + 'angularMomentum': [0], 'coefficients': [ [ -0.32279868167000036, diff --git a/src/extensions/alpha-orbitals/collocation.ts b/src/extensions/alpha-orbitals/collocation.ts index b202f88d3..be99f52eb 100644 --- a/src/extensions/alpha-orbitals/collocation.ts +++ b/src/extensions/alpha-orbitals/collocation.ts @@ -1,13 +1,15 @@ /** * Copyright (c) 2020 mol* contributors, licensed under MIT, See LICENSE file for more info. * + * Inspired by https://github.com/dgasmith/gau2grid. + * * @author David Sehnal <david.sehnal@gmail.com> */ import { Vec3 } from '../../mol-math/linear-algebra'; import { RuntimeContext } from '../../mol-task'; import { arrayMin } from '../../mol-util/array'; -import { Basis, CubeGridInfo, SphericalElectronShell } from './cubes'; +import { Basis, CubeGridInfo } from './cubes'; import { normalizeBasicOrder, SphericalFunctions, @@ -36,7 +38,14 @@ export async function sphericalCollocation( for (const atom of basis.atoms) { for (const shell of atom.shells) { - baseCount += 2 * shell.angularMomentum + 1; + for (const L of shell.angularMomentum) { + if (L > 4) { + // TODO: will L > 4 be required? Would need to precompute more functions in that case. + throw new Error('Angular momentum L > 4 not supported.'); + } + + baseCount += 2 * L + 1; + } } } @@ -45,36 +54,34 @@ export async function sphericalCollocation( let baseIndex = 0; for (const atom of basis.atoms) { for (const shell of atom.shells) { - const L = shell.angularMomentum; - - if (L > 4) { - // TODO: will L > 4 be required? Would need to precompute more functions in that case. - throw new Error('Angular momentum L > 4 not supported.'); - } - - const alpha = normalizeBasicOrder( - L, - alphaOrbitals.slice(baseIndex, baseIndex + 2 * L + 1), - sphericalOrder - ); - baseIndex += 2 * L + 1; - - collocationBasis( - matrix, - grid, - atom.center, - cutoffThreshold, - alpha, - shell - ); - - if (taskCtx.shouldUpdate) { - await taskCtx.update({ - message: 'Computing...', - current: baseIndex, - max: baseCount, - isIndeterminate: false, - }); + let amIndex = 0; + for (const L of shell.angularMomentum) { + const alpha = normalizeBasicOrder( + L, + alphaOrbitals.slice(baseIndex, baseIndex + 2 * L + 1), + sphericalOrder + ); + baseIndex += 2 * L + 1; + + collocationBasis( + matrix, + grid, + L, + shell.coefficients[amIndex++], + shell.exponents, + atom.center, + cutoffThreshold, + alpha + ); + + if (taskCtx.shouldUpdate) { + await taskCtx.update({ + message: 'Computing...', + current: baseIndex, + max: baseCount, + isIndeterminate: false, + }); + } } } } @@ -85,15 +92,14 @@ export async function sphericalCollocation( function collocationBasis( matrix: Float32Array, grid: CubeGridInfo, + L: number, + coefficients: number[], + exponents: number[], center: Vec3, cutoffThreshold: number, - alpha: number[], - shell: SphericalElectronShell + alpha: number[] ) { - const L = shell.angularMomentum; - const exponents = shell.exponents; const ncoeff = exponents.length; - const coefficients: number[] = sumCoefficients(shell.coefficients); const sphericalFunc = SphericalFunctions[L]; const cx = center[0], @@ -152,21 +158,6 @@ function collocationBasis( } } -function sumCoefficients(coefficients: number[][]) { - if (coefficients.length === 1) return coefficients[0]; - - const ret: number[] = []; - const len = coefficients[0].length; - for (let i = 0; i < len; i++) ret[i] = 0; - - for (let j = 0; j < coefficients.length; j++) { - const row = coefficients[j]; - for (let i = 0; i < len; i++) ret[i] += row[i]; - } - - return ret; -} - function getRadiusBox(grid: CubeGridInfo, center: Vec3, radius: number) { const r = Vec3.create(radius, radius, radius); const min = Vec3.scaleAndAdd(Vec3(), center, r, -1); diff --git a/src/extensions/alpha-orbitals/cubes.ts b/src/extensions/alpha-orbitals/cubes.ts index e7eb4fb8e..bc9cbb93f 100644 --- a/src/extensions/alpha-orbitals/cubes.ts +++ b/src/extensions/alpha-orbitals/cubes.ts @@ -1,6 +1,8 @@ /** * Copyright (c) 2020 mol* contributors, licensed under MIT, See LICENSE file for more info. * + * Inspired by https://github.com/dgasmith/gau2grid. + * * @author David Sehnal <david.sehnal@gmail.com> */ @@ -34,9 +36,11 @@ export interface Basis { }[]; } +// Note: generally contracted gaussians are currently not supported. export interface SphericalElectronShell { - angularMomentum: number; exponents: number[]; + angularMomentum: number[]; + // number[] for each angular momentum coefficients: number[][]; } diff --git a/src/extensions/alpha-orbitals/orbitals.ts b/src/extensions/alpha-orbitals/orbitals.ts index e246c2305..e36f54af1 100644 --- a/src/extensions/alpha-orbitals/orbitals.ts +++ b/src/extensions/alpha-orbitals/orbitals.ts @@ -1,6 +1,8 @@ /** * Copyright (c) 2020 mol* contributors, licensed under MIT, See LICENSE file for more info. * + * Inspired by https://github.com/dgasmith/gau2grid. + * * @author David Sehnal <david.sehnal@gmail.com> */ -- GitLab