### API ### Simulations using spin descriptions =================================== .. autofunction:: superspinsim.simspins .. autofunction:: superspinsim.models.nv_7 Spin description syntax ======================= SuperSpinsim comes with helper tools to construct spin systems, like NV centres in diamond, using a description from standard python datastructures. At the lowest level, we have individual spins, which are based on a model of atoms. These describe an electron spin, a nuclear spin, their individual properties, and their hyperfine interactions. Spins are then grouped into "blocks" in which all spins in the block have the ability to be coherent with each other and have spin-spin interactions. These block structures can also be used for defining multiple hyperfine interactions between electrons and neighbouring nuclei in a crystal structure. Finally, multiple blocks can be defined which can only have incoherent interactions between them. This can be used to model the incoherent transitions between orbitals in an NV centre. Individual spins ---------------- The description of each individual spin is organised into a python :obj:`dict` using the keys as described below. The :obj:`dict` s of individual spins inside a coherent block are organised into a python :obj:`list`. Finally, all of the :obj:`list` s describing individual blocks are organised into an encompassing :obj:`list`. This means that the definition of all individual spins to be simulated will be a :obj:`list` of :obj:`list` s, of :obj:`dict` s. Here the main :obj:`list` contains the :obj:`list` s of group descriptions, and the group descriptions contain the :obj:`dict` s spin descriptions. General ~~~~~~~ ================ ============================================================= Key Description ================ ============================================================= :obj:`B0` Bias/system/quiescent magnetic field in Tesla. If defined, magnetic field terms generated by this field are added to the system Hamiltonian/Lindbladian. In this case, dynamic magnetic field coefficients are perturbations from this field. :obj:`T` Spin temperature in Kelvin. Used in calculating the :math:`T_1` collapse operators. :obj:`Rb_gets_a` Coordinate transformation matrix between the perspective of the spin to the perspective of applied magnetic field. Can be used to define :math:`z` for spins to be the quantisation axis, and :math:`z` for magnetic fields to be something that makes more sense spatially. ================ ============================================================= Electron ~~~~~~~~ ============= ================================================== Key Description ============= ================================================== :obj:`S` Electron spin quantum number. Can be absent if a nuclear spin is defined. :obj:`g` Longitudinal electron g factor. :obj:`g_perp` Transverse electron g factor. If undefined, it is assumed that g is isotropic. :obj:`D` Zero-field splitting in radians/second. :obj:`E` Transverse zero-field splitting in radians/second. :obj:`TS1` Electron :math:`T_1` time in seconds. :obj:`TS2` Electron :math:`T_2` time in seconds. ============= ================================================== Nucleus ~~~~~~~ ============== =============================================================== Key Description ============== =============================================================== :obj:`I` Nuclear spin quantum number. :obj:`gN` Longitudinal nuclear g factor (nuclear magneton convention). :obj:`gN_perp` Transverse nuclear g factor (nuclear magneton convention). If no transverse nuclear g factor is undefined, it is assumed that gN/gI1 is isotropic. :obj:`gI` Longitudinal nuclear g factor (Bohr magneton convention). :obj:`gI_perp` Transverse nuclear g factor (Bohr magneton convention). If no transverse nuclear g factor is undefined, it is assumed that gN/gI1 is isotropic. :obj:`P` Nuclear qudrupole moment in radians/second. :obj:`A` Longitudinal hyperfine interaction in radians/second. :obj:`A_perp` Transverse hyperfine interaction in radians/second. If undefined, it is assumed that A is isotropic. :obj:`TI1` Nuclear :math:`T_1` time in seconds. :obj:`TI2` Nuclear :math:`T_2` time in seconds. ============== =============================================================== Spin-spin interaction description --------------------------------- The interaction between two spins within a coherent block is described by a python :obj:`dict`, using the keys as described below. Each of these individual descriptions for just two spins are organised into an encompassing :obj:`dict` for the entire coherent block. Here, the keys for the block :obj:`dict` are python :obj:`tuple` s of the :obj:`list` indices of the individual atom description. For example, the :obj:`dict` under the key :obj:`(0, 1)` will define the coupling between spins 0 and 1. There is then an encompassing :obj:`list` which contains the :obj:`dict` s that describe each coherent block. Therefore, the description of the coherent interactions between spins takes the form of a :obj:`list` of :obj:`dict` s of :obj:`dict` s. ============= ========================================================== Key Description ============= ========================================================== :obj:`J` Longitudinal interaction between the two spins in radians/second. :obj:`J_perp` Transverse interaction between the two spins in radians/s. If undefined, it is assumed that J is isotropic. ============= ========================================================== Incoherent interactions between coherent blocks ----------------------------------------------- The incoherent interaction between two spins in different coherent blocks is defined by a python :obj:`dict`, with keys as defined below. These :obj:`dict` s are organised into an encompassing :obj:`dict` under keys of the form :obj:`((block_0, spin_0), (block_1, spin_1))`. Here, the spin of index :obj:`spin_0` from coherent block :obj:`block_0` is interacting with a spin of index :obj:`spin_0` from coherent block :obj:`block_0` . Therefore, the description of the incoherent interactions between spins of different blocks takes the form of a :obj:`dict` of :obj:`dict` s. These blocks are designed to model the orbital interactions of the NV centre. =============== ============================================================== Key Description =============== ============================================================== :obj:`rel` Spin-conserving optical relaxation rate in population/second. :obj:`rel_n` Spin-nonconserving optical relaxation rate in population/second. :obj:`s_gets_0` Transition rate from the :math:`m_S=0` state of a triplet to a singlet, in population/second. Useful for modelling NV centres in diamond. :obj:`s_gets_1` Transition rate from the :math:`m_S=\pm1` states of a triplet to a singlet, in population/second. Useful for modelling NV centres in diamond. :obj:`0_gets_s` Transition rate from a singlet to the :math:`m_S=0` state of a triplet, in population/second. Useful for modelling NV centres in diamond. :obj:`1_gets_s` Transition rate from a singlet to the :math:`m_S=\pm1` states of a triplet, in population/second. Useful for modelling NV centres in diamond. =============== ============================================================== Simulations using QuTiP-syntax ============================== .. autofunction:: superspinsim.mesolve .. .. autofunction:: superspinsim.generate_simulator Visualisation ============= .. autofunction:: superspinsim.colour_complex_matrix