← Back to team overview

yade-dev team mailing list archive

Interesting tidbit from Quantum Mechanics

 

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