From b17edde85e216b37508f9a9f2fa94052dbdaf30e Mon Sep 17 00:00:00 2001 From: Clark Miyamoto <96753914+clarkmiyamoto@users.noreply.github.com> Date: Wed, 19 Jul 2023 01:27:43 -1000 Subject: [PATCH 1/3] Added more clarity to units --- docs/source/guide/guide-units.rst | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/docs/source/guide/guide-units.rst b/docs/source/guide/guide-units.rst index 7553c2c..bd5bff1 100644 --- a/docs/source/guide/guide-units.rst +++ b/docs/source/guide/guide-units.rst @@ -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 assumes Plank's constant $h = 1$, meaning energy and 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:: @@ -22,3 +21,23 @@ 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 +*************** +Defining ``EJ`` and ``EC`` would refer to $E_J / 2\\pi$ and $E_C /2\\pi$ in literature. 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 + +Another example starts with defining ``qubit_01_freq`` and ``qubit_anharmonicity`` which corresponds to $f_{01} = \\omega_{01} / 2 \\pi$ and $\\alpha / 2 \\pi$. 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 From 3041d4198520da8d273a91bfa1eddf90c51aba43 Mon Sep 17 00:00:00 2001 From: Clark Miyamoto <96753914+clarkmiyamoto@users.noreply.github.com> Date: Wed, 19 Jul 2023 01:35:50 -1000 Subject: [PATCH 2/3] Corrected Examples header in `guide-units.rst` --- docs/source/guide/guide-units.rst | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/source/guide/guide-units.rst b/docs/source/guide/guide-units.rst index bd5bff1..d48f7ed 100644 --- a/docs/source/guide/guide-units.rst +++ b/docs/source/guide/guide-units.rst @@ -22,9 +22,10 @@ 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 -*************** +-------- + Defining ``EJ`` and ``EC`` would refer to $E_J / 2\\pi$ and $E_C /2\\pi$ in literature. Written in code looks like:: scqubits.set_units('GHz') From 380d4f973b31c9edb94ac358a878c75b6be0b2ab Mon Sep 17 00:00:00 2001 From: clarkmiyamoto Date: Wed, 1 Nov 2023 13:17:27 -0400 Subject: [PATCH 3/3] Removed references of EC/2pi to avoid confusion. --- docs/source/guide/guide-units.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/source/guide/guide-units.rst b/docs/source/guide/guide-units.rst index d48f7ed..27deaf6 100644 --- a/docs/source/guide/guide-units.rst +++ b/docs/source/guide/guide-units.rst @@ -10,7 +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 can be shown in a list using the function ``show_supported_units``. These are: ``GHz`` (default), ``MHz``, ``kHz`` and ``Hz``. The package also assumes Plank's constant $h = 1$, meaning energy and frequency have the same units. +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:: @@ -26,7 +26,7 @@ from `Hz`. This is accomplished with functions ``to_standard_units`` and ``from_ Examples -------- -Defining ``EJ`` and ``EC`` would refer to $E_J / 2\\pi$ and $E_C /2\\pi$ in literature. Written in code looks like:: +Let's start by creating a Transmon from a given $E_J, E_C$. Written in code looks like:: scqubits.set_units('GHz') @@ -36,7 +36,7 @@ Defining ``EJ`` and ``EC`` would refer to $E_J / 2\\pi$ and $E_C /2\\pi$ in lite ncut=31) energies = tmon.eigenvals(evals_count=3) # Outputs in Linear GHz -Another example starts with defining ``qubit_01_freq`` and ``qubit_anharmonicity`` which corresponds to $f_{01} = \\omega_{01} / 2 \\pi$ and $\\alpha / 2 \\pi$. Written in code looks like:: +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