yade-dev team mailing list archive
-
yade-dev team
-
Mailing list archive
-
Message #12019
Interesting tidbit from Quantum Mechanics
-
To:
yade-dev@xxxxxxxxxxxxxxxxxxx
-
From:
Janek Kozicki <janek_listy@xxxxx>
-
Date:
Thu, 7 May 2015 23:59:50 +0200
-
Face:
iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAALVBMVEUBAQEtLS1KSkpRUVFXV1dYWFhjY2Nzc3N3d3eHh4eKioqdnZ24uLjLy8vc3NxVIagyAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH2AIVEzgS1fgQtQAAAjRJREFUOMtt1DFv00AUAOAzFQNbjigSyoQaRaBMhKgLUyKXpVNNeUpk9vyDqFJhQ1kiBuaqAwJCqvPtSLY7RlTn5+5IdnYkkt/AOyfxXVLe5vf53Z1875kd34tOEax8djmj6GyjhB5bxz50GdsVZr9fqRjZwAtKOJw5Wqs2MMZ16ALHsaDncF7xAHix1oEFHAB8f+pRjcO4gfZDykcYzbiucRolOLUJ6kjA0xtVt+A6TySlM0RajIpK6DzwKZ/nOYbF/gclHMo1ZOHYY/+Ha+AWuM+3oMS4eeqYzZ8FiCltgUqI8cd2wwAVpJk+8LWYjBtnJdQpHQqJMd4Oxt4bU9ESiFGc5hkqaH74asAX4iabP5I5gZ+qjgGlJCqZa3h3lxhoeVcSE1qLQC4sqKOK9MGW9E3izFqqHokoztLFEgXg31sbZEKnWi2T74A4NxfVQqlkjKtcAWD+zcArFEES01dR0E/nnV0IgugmDd/2L84sOAouRBBHEc7gtc8teDkRlE0iNQPo2w3Xhh/D4TCIQ4LRLoTvgwjj6RRgavdurxYGMaIuGOyAW/PpNlCcU9/93AHenAWYjPoAwa+G3e3to/MgFNTAEKvKDjzuCzHTnY3qqdXtx24VijzQfZ0yewZ5cwRFQaa+mIYr1uI0I76+3W4xhlvoVRwOA0Fdl64HlJnxP6T8YpX/Lga4Wv4A3ErrU5oTfN7Mu/llXMl8RXEPji/lQkN3H7qXqgC2By47EXeU/7PJ/wPxRKMnuZwIeAAAAABJRU5ErkJggg==
Hi,
I'm cleaning up my code in order to add multi particle systems (side
effect is enabling quantum entanglement). And I realized a quite
interesting thing:
The Collider, e.g. this one:
SpatialQuickSortCollider([
Bo1_Box_Aabb(),
]),
detects collisions by generating `bound` from `shape`. It turns
however that I have no `shape` in quantum mechanics unless it is
generated from `state` just like Bo1_Box_Aabb() generates `bound`
from `shape`. And even more to have `state` I must generate it using
`material` !
And so it turns out for me that I'll be adding two more functors, so I'll have:
StateFunctor Material → State
ShapeFunctor State → Shape
BoundFunctor Shape → Bound
Then I realized, that this problem was already being "walked around"
in our DEM code. Especially calculating mass and inertia using
density. It was always done in some separate code. Usually in python
or inside some *Generators.
In the case of spheres the inertia and mass are calculated only once,
so it didn't hurt much to put it in python or in *Generator.
But in case of my quantum wavefunctions it depends: sometimes the
state must be updated every iteration from state (in case of analytic
solutions which I use to verify my numerical calculations), and
sometimes it's done only upon start of the calculations (to
initialize my wavefunctions from the analytical formulas).
And the most important thing is that I cannot "walk around" it like
we did before, by doing it in some *Generator or in python code. That
is because the generation of `state` from `material` are quite
intensive calculations. And in python it would be slow. Also this is
a very generic calculation - shouldn't go into any *Generator that is
usually aimed at some particular type of simulation case. It is true
even if this has to be done only once at the start of the simulation.
Then maybe, just maybe, in the DEM code it would be better to move
all those duplicated lines that calculate inertia from density into a
single StateFunctor? I see plenty of duplicated code doing just that.
Then maybe use the ShapeFunctor to find the extents of clumps? Just an idea :-)
It was quite a revelation for me. I still need to think on how to do
it the best way. But if you have any comments, I'm glad to hear that.
Btw, if you want to play with quantum mechanics, you can download my
fork, run all examples, and play with the display options inside
Inspect->Body->Shape.
git clone git@xxxxxxxxxx:cosurgi/trunk.git
best regards
--
Janek Kozicki http://janek.kozicki.pl/ |
Follow ups