Simulation and visualization
of spherical hydrodynamics
github.com/klasmodin/quflow
git clone https://github.com/klasmodin/quflow.git cd quflow pip install .
Classical
function \(\omega:S^2\to\mathbb{R}\)
spherical harmonics \(\omega = \sum_{l=0}^\infty\sum_{m=-l}^l\omega^{lm}Y_{lm}\)
Quantized
complex matrix \(W\in\mathfrak{u}(N)\)
matrix harmonics \(W = \sum_{l=0}^N\sum_{m=-l}^l\omega^{lm}T_{lm}\)
import quflow as qf omega = np.random.randn(10) N = 512 W = qf.shr2mat(omega, N) qf.plot(W)
real spherical harmonics
Classical time: seconds
Quantum time: qtime
1 second = \(\displaystyle\frac{1}{\sqrt{16\pi}}N^{3/2}\) qtime
General rule:
import quflow as qf N = 512 print(qf.seconds2qtime(1.0, N)) print(qf.qtime2seconds(1.0, N))
High-level solve function:
import quflow as qf N = 128 W0 = qf.shr2mat(np.random.randn(10), N) h = 0.1 mysim = qf.QuData("mysim.hdf5") mysim(W0, 0.0) # Save first output qf.solve(W0, qstepsize=h, time=3.0, inner_time=0.2, callback=mysim) mysim.flush()
By Klas Modin
Demonstration of the Python software QUFLOW for simulation of Euler's equations on the sphere.
Mathematician at Chalmers University of Technology and the University of Gothenburg