SpinDynamica support > Simulations

Commutator[], Matrixexponential, Subspace

(1/1)

**dornenfeld**:

Hey everyone,

came along some problems while trying to work with Spindynamica. Tried to formulate all questions in attached mathematica file.

Also want to say thanks for the package overall, its very useful. If you need more clarification, please feel free to ask. Also open to any suggestions.

Really appreciate any help you can provide,

Hannes

**Christian Bengs**:

Hey Hannes,

Sorry for the late reply, but I've finally had a quick look at your notebook.

1) There is really no need to let SpinDynamica know what a commutator equals when constructing the matrix representation of a superoperator. The commutation relations will be dealt with "automatically".

2) There is really no way to reduce the size of the matrix unless your Hamiltonian might display some symmetry. In this case you can define your own basis and focus on the relevant subspace. A useful syntax to order the matrix into its subspaces is as follows:

Flatten[ConnectedComponents[Rule @@@MatrixRepresentation[H]]["NonzeroPositions"]]]

This will return a permutation that permutes the Hamiltonian into block-diagonal form.

3) The reason the last calculation doesn't stop is because the analytic calculation of the matrix exponential takes very long. You may circumvent the problem by first calculating the matrix exponential in a "simple" basis and then transform back into your preferred basis.

4) Unfortunately SpinDynamica has no capabilities to restrict calculations to a certain subspace atm.

kind regards,

Christian

Navigation

[0] Message Index

Go to full version