Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added more clarity to units #14

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 22 additions & 2 deletions docs/source/guide/guide-units.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ Units
scqubits provides a means to set default units for the assumed energies of the quantum systems. These units play a key
role in :ref:`guide_noise` calculations. They are also used to set axes labels in some plot types.

The currently supported units are: ``GHz``, ``MHz``, ``kHz`` and ``Hz``, with ``GHz`` being the default.
A list containing these possible choices can be shown with the ``show_supported_units`` function.
The currently supported units can be shown in a list using the function ``show_supported_units``. These are: ``GHz`` (default), ``MHz``, ``kHz`` and ``Hz``. The package also sets Plank's constant $h = 1$, meaning energy and linear frequency have the same units.

The current units setting can be obtained with the ``get_units`` function. A new setting can be established with the
``set_units`` function::
Expand All @@ -22,3 +21,24 @@ The current units setting can be obtained with the ``get_units`` function. A new

scqubits also includes several helper functions for convenient conversion from the current system units to and
from `Hz`. This is accomplished with functions ``to_standard_units`` and ``from_standard_units``.


Examples
--------

Let's start by creating a Transmon from a given $E_J, E_C$. Written in code looks like::

scqubits.set_units('GHz')

tmon = scqubits.Transmon(EJ=30.02, # Linear GHz
EC=1.2, # Linear GHz
ng=0.3,
ncut=31)
energies = tmon.eigenvals(evals_count=3) # Outputs in Linear GHz

Now let's do the inverse. For a given qubit's resonsant frequency $f_{01}$ and anharmonicity $\\alpha$$, determine $E_J, E_C$. Written in code looks like::

qubit_01_freq = 3.882 # Linear GHz
qubit_anharmonicity = -0.180 # Linear GHz

EJ, EC = TunableTransmon.find_EJ_EC(E01=qubit_01_freq, anharmonicity=qubit_anharmonicity) # Outputs in Linear GHz