- #1
alexmurillo242
- 1
- 1
- TL;DR Summary
- Since matrices are handled as lists of lists in Mathematica and the Piecewise() function's first argument expects a list of pairs what type of strategy would you all use for defining a Hamiltonian that abruptly changes in time (Image included)
Hi all,
I'm doing some light simulations for an experiment I'm going to be running soon. I've ran through the math symbolically on paper but I'm not exactly eager for handling this large of matrices by hand so I'm trying to work through it and see if I can generate a simulated signal to compare my results against.
There is a Hamiltonian (Hzf15) which is present throughout the entire time and is an inherent structural part of the molecule and I'm trying to implement a hard RF pulse in the x-direction represented by HxDC that is applied for a period of time (PulseTime) that is initiated at t = 0.
Due to the way that the Piecewise[] function works by having a list of pairs and matrices are stored as a list of lists I get the error seen at the bottom. How would you all recommend going about defining such a function? I have started trying to rewrite this all in Matlab but I have significantly less experience with it so we'll see how that goes.![Face with tears of joy :joy: 😂](https://cdn.jsdelivr.net/joypixels/assets/8.0/png/unicode/64/1f602.png)
I'm still rather new to the whole simulation side of this so any general recommendations would be appreciated as well especially if its just a syntactic error.
P.S. for more detail all of the operators here are for operating on a system of 5 spin-1/2 particles with tetrahedral symmetry around a heteroatom center.
I'm doing some light simulations for an experiment I'm going to be running soon. I've ran through the math symbolically on paper but I'm not exactly eager for handling this large of matrices by hand so I'm trying to work through it and see if I can generate a simulated signal to compare my results against.
There is a Hamiltonian (Hzf15) which is present throughout the entire time and is an inherent structural part of the molecule and I'm trying to implement a hard RF pulse in the x-direction represented by HxDC that is applied for a period of time (PulseTime) that is initiated at t = 0.
Due to the way that the Piecewise[] function works by having a list of pairs and matrices are stored as a list of lists I get the error seen at the bottom. How would you all recommend going about defining such a function? I have started trying to rewrite this all in Matlab but I have significantly less experience with it so we'll see how that goes.
![Face with tears of joy :joy: 😂](https://cdn.jsdelivr.net/joypixels/assets/8.0/png/unicode/64/1f602.png)
I'm still rather new to the whole simulation side of this so any general recommendations would be appreciated as well especially if its just a syntactic error.
P.S. for more detail all of the operators here are for operating on a system of 5 spin-1/2 particles with tetrahedral symmetry around a heteroatom center.