tebdol

Simulation of ultracold atoms in optical lattices
git clone https://miroslavurbanek.com/git/tebdol.git
Log | Files | Refs | README

commit 556a0755b6616ca2c95b124f74f3c97100abf5f6
parent e314eb37d13058deffafbe97dd725026146f00eb
Author: Miroslav Urbanek <mu@miroslavurbanek.com>
Date:   Wed,  2 Dec 2015 04:40:13 +0100

Add support for distributed propagators

A MPO can contain a NIL if the respective tensor belongs to a
different node.

Diffstat:
tebdol/tebd.lisp | 19+++++++++----------
1 file changed, 9 insertions(+), 10 deletions(-)

diff --git a/tebdol/tebd.lisp b/tebdol/tebd.lisp @@ -70,22 +70,21 @@ (tensor-exponential h '((0 2) (1 3)) (* -1 +blas-i+ step)))) (defun make-single-propagators (mph step) - (list (make-single-site-propagator (svref mph 0) step) - (make-single-site-propagator (svref mph (1- (length mph))) step))) + (let ((f (svref mph 0)) + (g (svref mph (1- (length mph))))) + (list (if f (make-single-site-propagator f step)) + (if g (make-single-site-propagator g step))))) (defun make-double-propagators (mph step) (loop with l = (1- (length mph)) with a = (make-array l) for i below l - do - (setf (svref a i) - (make-double-site-propagator - (svref mph i) - (svref mph (1+ i)) - step)) - finally - (return a))) + for f = (svref mph i) + for g = (svref mph (1+ i)) + when (and f g) + do (setf (svref a i) (make-double-site-propagator f g step)) + finally (return a))) (defstruct propagator single1