Simulation and visualization

of spherical hydrodynamics

 

github.com/klasmodin/quflow

Installation

git clone https://github.com/klasmodin/quflow.git
cd quflow
pip install .

Basic concepts

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)

Units of time

Classical time: seconds

Quantum time: qtime

1 second = \(\displaystyle\frac{1}{\sqrt{16\pi}}N^{3/2}\) qtime

General rule:

  • numerical parameters use qtime (e.g. stepsize)
  • physical parameters use second (e.g. total simulation time)
import quflow as qf
N = 512
print(qf.seconds2qtime(1.0, N))
print(qf.qtime2seconds(1.0, N))

Running simulations

High-level solve function:

  • initial data \(W_0\in\mathfrak{u}(N)\)
  • simulation step-size (qtime)
  • total simulation time (seconds)
  • inner simulation time (seconds)
    (how often callback)
  • callback function (typically QuData object)
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()

Generic smooth initial data

Generic vanishing momentum smooth initial data