Hi, Prof. Kuprov,
Here is a question regards proccessing inhomogeneous B0 within the liquid NMR simulation.
A direct way is updating the 'spin_system.inter.zeeman.matrix' and running the simulation for each voxel, like the script below. But it will cause long program in multiple spins case.
So I want to ask if there is any interface in Spinach, that I can define the spin_system quickly.
Thank you.
Mengjia
Simulartion with inhomogeneous Field
-
- Posts: 16
- Joined: Thu Jan 20, 2022 8:28 am
Simulartion with inhomogeneous Field
- Attachments
-
- screen1.PNG (77.17 KiB) Viewed 941 times
Re: Simulartion with inhomogeneous Field
I would recommend setting the magnetic field to 1 Tesla in the sys.magnet, and then requesting separately the Zeeman part and the coupling part of the Hamiltonian by using the retention options described here:
https://spindynamics.org/wiki/index.php?title=Assume.m
that way you only need to build the Hamiltonians once. Then combine them into H=Hc+B*Hz where B is your actual field in Tesla. Then use that to run the simulation of your choice with that Hamiltonian.
For integrating over the field distribution, I recommend the Gauss-Legendre quadrature:
https://spindynamics.org/wiki/index.php ... Gaussleg.m
https://spindynamics.org/wiki/index.php?title=Assume.m
that way you only need to build the Hamiltonians once. Then combine them into H=Hc+B*Hz where B is your actual field in Tesla. Then use that to run the simulation of your choice with that Hamiltonian.
For integrating over the field distribution, I recommend the Gauss-Legendre quadrature:
https://spindynamics.org/wiki/index.php ... Gaussleg.m
-
- Posts: 16
- Joined: Thu Jan 20, 2022 8:28 am
Re: Simulartion with inhomogeneous Field
Sounds nice way, I would try.