From time to time I get back to Spinach and proceed with the 1H-1H chemical exchange simulations under MAS. For two spins it is extremely fast and I can simulate relaxation decay curves within seconds. However even when I go from 2 to 3 spins the calculations slow down significantly. I've tried to use different basis set approximations however for this simple solid sample (three protons which are 4-5 A from each other and one of them changes position on the microsecond timescale), I need a bas.space_level of 3, right? But then the Focker-Planck problem dimension will be the same as if I did not use any approximations.
So, which approximation would you suggest with what conditions? What else shall I change to speed up the calculations? For example I even reduced the parameters.max_rank value to 2 (I don't expect to see any spinning sidebands, since I don't define any CSA just the isotropic part and I spin at 40 kHz). Can I go down to 1?
Right now one simulation of a relaxation decay curve with 3 spins (no approximations, max_rank = 2) takes about 4-5 minutes on my laptop. I would like to simulate however several of such decay curves and then even move towards more spins. You said, Spinach can easily handle problems up to 20 spins. I know, that might be only true for solution state systems. What is the limit for solid state?
My final ultimate goal for simulation would be a peptide stretch circa 10 residues where I would simulate only the amide protons an nitrogens (i.e ~20 spins) and this stretch would exchange between two spatial positions on the microsecond timescale. Do you think this would be possible within a reasonable calculation time?
I have another technical question. Is it possible to propagate rho during the evolution function in uneven steps? I use the evolution function for spin-locking the magnetization and with the trajectory option I get the FIDs for every steps. Instead of even sampling I would like to sample it on a logarithmic scale. But this is not so important now.
Speeding up solid state simulations
Re: Speeding up solid state simulations
I would suggest that you run with bas.approximation=’none’ - for small spin systems no redulction is possible anyway. Try the following:
sys.disable={‘trajlevel’};
That can sometimes speed up solid state calculations. Beyond that, I would need to take a direct look to see where the slow stages are. If you replace “parfor” with “for” inside singlerot.m, you would be able to get the informative output from the profiler -- what is the slowest stage at the moment?
Regarding the Fokker-Planck rank: yes, you can try reducing it, but be careful! Make sure the result does not change. If it changes even a little bit, you need to increase the level back because convergence on the rank is strictly required for a valid answer. How big is your spherical grid and does it need to be that big?
You will be able to use incomplete basis sets from about 5 spins onwards, but for small spin systems you need the complete basis set.
Regarding uneven time steps -- the quick answer is “it would be slower”. At the moment, a matrix exponential for a fixed step is computed once and then applied multiple times. If you have different time steps, you would need to compute many matrix exponentials. That is significantly slower than matrix-vector multiplications that are needed for fixed-step propagation.
sys.disable={‘trajlevel’};
That can sometimes speed up solid state calculations. Beyond that, I would need to take a direct look to see where the slow stages are. If you replace “parfor” with “for” inside singlerot.m, you would be able to get the informative output from the profiler -- what is the slowest stage at the moment?
Regarding the Fokker-Planck rank: yes, you can try reducing it, but be careful! Make sure the result does not change. If it changes even a little bit, you need to increase the level back because convergence on the rank is strictly required for a valid answer. How big is your spherical grid and does it need to be that big?
You will be able to use incomplete basis sets from about 5 spins onwards, but for small spin systems you need the complete basis set.
Regarding uneven time steps -- the quick answer is “it would be slower”. At the moment, a matrix exponential for a fixed step is computed once and then applied multiple times. If you have different time steps, you would need to compute many matrix exponentials. That is significantly slower than matrix-vector multiplications that are needed for fixed-step propagation.