ppower.m

From Spinach Documentation Wiki
Jump to: navigation, search

Computes integer propagator powers via an efficient powers-of-two based strategy. The power is cast into an unsigned 64-bit integer; a zero power returns a unit matrix with the same dimension, class, and sparsity as the input, and a unit power returns the input unchanged. Otherwise the routine walks the binary digits of N from the least significant end, multiplying the current square of the propagator into the accumulator whenever the digit is set, and squaring the propagator only while higher digits remain. Every product is passed through clean_up.m with the spin_system.tols.prop_chop tolerance.

Syntax

    P=ppower(spin_system,P,N)

Parameters

    spin_system - Spinach spin system object

    P   - propagator matrix

    N   - non-negative integer propagator power

Outputs

    P   - propagator matrix raised to the power of N

Notes

The algorithm expands N into binary powers, squares P successively, and multiplies only the active powers into the result. This avoids explicit repeated multiplication. Propagator powers are cleaned up using spin_system.tols.prop_chop.

See also

propagator.m, clean_up.m, evolution.m, step.m, Kernel functions

Version 2.13, authors: Ilya Kuprov