Differences
This shows you the differences between two versions of the page.
| documentation:language_reference:objects:wavefunction:properties:nb [2016/09/25 13:54] – created Maurits W. Haverkort | documentation:language_reference:objects:wavefunction:properties:nb [2025/11/20 04:20] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| + | ====== NB ====== | ||
| + | ### | ||
| + | unsigned integer, read and write | ||
| + | ### | ||
| + | |||
| + | ### | ||
| + | **Current version does not suport bosons, i.e. NB must always be //0//.** | ||
| + | ### | ||
| + | |||
| + | ### | ||
| + | An integer representing the number of Bosons in the basis. For wavefunction //psi//, index //0// to // | ||
| + | ### | ||
| + | |||
| + | ===== Example ===== | ||
| + | |||
| + | ### | ||
| + | We can define the function: | ||
| + | $$ | ||
| + | |\psi\rangle = \left(\frac{1}{\sqrt{4}} a^{\dagger}_0 a^{\dagger}_1 + \frac{1}{\sqrt{4}} a^{\dagger}_0 a^{\dagger}_2 + (1+I)\frac{1}{\sqrt{4}} a^{\dagger}_1 a^{\dagger}_2 \right)|0\rangle, | ||
| + | $$ | ||
| + | changing the number of bosons in the basis from 0 to 2 currently results in an error. | ||
| + | ### | ||
| + | |||
| + | ==== Input ==== | ||
| + | <code Quanty Example.Quanty> | ||
| + | NF=3 | ||
| + | NB=0 | ||
| + | psi = NewWavefunction(NF, | ||
| + | print(psi.NB) | ||
| + | psi.NB=2 | ||
| + | </ | ||
| + | |||
| + | ==== Result ==== | ||
| + | <file Quanty_Output> | ||
| + | 0 | ||
| + | Error while executing the script: | ||
| + | / | ||
| + | </ | ||
| + | |||
| + | ===== Available properties ===== | ||
| + | {{indexmenu> | ||