Difference between revisions of "Create.m"
(Sync syntax/arguments/outputs with current Spinach source) |
(Document Spinach 2.12 bosonic mode functionality (PR 195)) |
||
| (4 intermediate revisions by the same user not shown) | |||
| Line 1: | Line 1: | ||
{{DISPLAYTITLE:create.m}} __NOTOC__ | {{DISPLAYTITLE:create.m}} __NOTOC__ | ||
| + | The entry function of the ''Spinach'' kernel that creates the spin system object that the rest of the library requires to run. It checks and absorbs interaction specifications, and writes some useful diagnostics to the console. | ||
| − | + | Bosonic modes - electromagnetic cavities, phonon modes, and transmons - are declared in [[sys]].isotopes and parameterised in the inter.modes input block, which is validated and absorbed by this function; see the [[Spin system specification#Bosonic modes|bosonic modes]] section of the spin system specification. Console summaries of mode parameters, mode couplings, and spin Hamiltonian modulation are printed as the block is ingested. | |
==Syntax== | ==Syntax== | ||
| − | [[spin_system]]=create([[sys]],[[inter]]) | + | [[spin_system]]=create([[sys]],[[inter]]) |
| − | == | + | ==Parameters== |
| − | sys - spin system and instrument specification | + | [[sys]] - spin system and instrument specification |
| − | structure, see the spin system | + | structure, see the [[spin system specification]] |
| − | + | section of the online manual | |
| − | + | ||
| − | inter - interaction specification structure, see | + | [[inter]] - interaction specification structure, see |
| − | see the spin system specification section | + | see the [[spin system specification]] section |
of the online manual | of the online manual | ||
==Outputs== | ==Outputs== | ||
| − | [[spin_system]] - the primary object used by Spinach | + | [[spin_system]] - the primary object used by Spinach |
to store simulation information | to store simulation information | ||
==Examples== | ==Examples== | ||
| − | |||
A simple spin system specification followed by a call to [[create.m]] appears below. There are hundreds of further examples in the example set. | A simple spin system specification followed by a call to [[create.m]] appears below. There are hundreds of further examples in the example set. | ||
| Line 37: | Line 37: | ||
% Spinach housekeeping | % Spinach housekeeping | ||
spin_system=create(sys,inter); | spin_system=create(sys,inter); | ||
| + | |||
| + | ==Notes== | ||
| + | # inter.modes.carriers declares, for each bosonic mode, the laboratory frequency of the rotating frame in which inter.modes.frqs is specified; declared frequencies are then detunings and may be negative, and thermal occupations are computed from the physical frequency, meaning the sum of the carrier and the detuning. | ||
| + | # inter.modes.t2_times is interpreted at the declared temperature: the pure dephasing rate is extracted as 1/T2-kappa*(1+2*nbar)/2, where kappa is the amplitude damping rate and nbar the thermal occupation at the physical mode frequency. | ||
| + | # Quadrature operators of bosonic modes follow the (a+a')/sqrt(2) normalisation everywhere, in inter.modes.longitudinal as well as in the modulation channels. | ||
| + | # [[inter]].temperature must be specified when any bosonic mode is damped; the room temperature default is refused, with an error message naming the thermal occupation that it would have implied. | ||
==See also== | ==See also== | ||
| − | + | [[basis.m]], [[assume.m]], [[operator.m]], [[state.m]], [[hamiltonian.m]], [[reduce.m]], [[thermalize.m]], [[device.m]], [[coherent.m]], [[rlx_modes.m]], [[cart2mode.m]], [[ejec2duffing.m]], [[Kernel_functions]] | |
| − | [[basis.m]], [[assume.m]], [[operator.m]], [[state.m]], [[hamiltonian.m]] | ||
| − | |||
''Version 2.4, authors: [[Ilya Kuprov]], [[Hannah Hogben]], [[Konstantin Pervushin]], [[Luke Edwards]]'' | ''Version 2.4, authors: [[Ilya Kuprov]], [[Hannah Hogben]], [[Konstantin Pervushin]], [[Luke Edwards]]'' | ||
Latest revision as of 05:40, 6 August 2026
The entry function of the Spinach kernel that creates the spin system object that the rest of the library requires to run. It checks and absorbs interaction specifications, and writes some useful diagnostics to the console.
Bosonic modes - electromagnetic cavities, phonon modes, and transmons - are declared in sys.isotopes and parameterised in the inter.modes input block, which is validated and absorbed by this function; see the bosonic modes section of the spin system specification. Console summaries of mode parameters, mode couplings, and spin Hamiltonian modulation are printed as the block is ingested.
Syntax
spin_system=create(sys,inter)
Parameters
sys - spin system and instrument specification structure, see the spin system specification section of the online manual inter - interaction specification structure, see see the spin system specification section of the online manual
Outputs
spin_system - the primary object used by Spinach to store simulation information
Examples
A simple spin system specification followed by a call to create.m appears below. There are hundreds of further examples in the example set.
% Set the spin system
sys.isotopes={'1H','1H'};
inter.zeeman.scalar={0.0 0.0};
inter.coordinates={[0.00 0.00 0.00];
[0.00 0.00 2.00]};
% Magnet field
sys.magnet=14.1;
% Spinach housekeeping
spin_system=create(sys,inter);
Notes
- inter.modes.carriers declares, for each bosonic mode, the laboratory frequency of the rotating frame in which inter.modes.frqs is specified; declared frequencies are then detunings and may be negative, and thermal occupations are computed from the physical frequency, meaning the sum of the carrier and the detuning.
- inter.modes.t2_times is interpreted at the declared temperature: the pure dephasing rate is extracted as 1/T2-kappa*(1+2*nbar)/2, where kappa is the amplitude damping rate and nbar the thermal occupation at the physical mode frequency.
- Quadrature operators of bosonic modes follow the (a+a')/sqrt(2) normalisation everywhere, in inter.modes.longitudinal as well as in the modulation channels.
- inter.temperature must be specified when any bosonic mode is damped; the room temperature default is refused, with an error message naming the thermal occupation that it would have implied.
See also
basis.m, assume.m, operator.m, state.m, hamiltonian.m, reduce.m, thermalize.m, device.m, coherent.m, rlx_modes.m, cart2mode.m, ejec2duffing.m, Kernel_functions
Version 2.4, authors: Ilya Kuprov, Hannah Hogben, Konstantin Pervushin, Luke Edwards