diff --git a/.DS_Store b/.DS_Store
new file mode 100644
index 0000000..94e8e06
Binary files /dev/null and b/.DS_Store differ
diff --git a/examples/demo_zeropi.ipynb b/examples/demo_zeropi.ipynb
index 1c93b69..6d90425 100644
--- a/examples/demo_zeropi.ipynb
+++ b/examples/demo_zeropi.ipynb
@@ -12,9 +12,16 @@
"---"
]
},
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "Set up Matplotlib for plotting into notebook, and import scqubits and numpy:"
+ ]
+ },
{
"cell_type": "code",
- "execution_count": 1,
+ "execution_count": 20,
"metadata": {
"ExecuteTime": {
"end_time": "2020-03-27T13:04:04.721293Z",
@@ -28,30 +35,38 @@
},
"outputs": [],
"source": [
- "%matplotlib inline\n",
- "%config InlineBackend.figure_format = 'svg'\n",
- "\n",
"import numpy as np\n",
"import scqubits as scq"
]
},
{
+ "attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
- "# zero-pi qubit (decoupled from zeta-mode)"
+ "# $0$-$\\pi$ qubit (decoupled from $\\zeta$-mode)"
]
},
{
+ "attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
- "$H=-2E_\\text{CJ}\\partial_\\phi^2+2E_{\\text{C}\\Sigma}(i\\partial_\\theta-n_g)^2-2E_\\text{J}\\cos\\theta\\cos(\\phi-\\varphi_\\text{ext}/2)+E_L\\phi^2+2E_\\text{J} +2E_{C\\Sigma}dC_J\\,\\partial_\\phi\\partial_\\theta + E_J dE_J \\sin\\theta\\sin(\\phi-\\phi_\\text{ext}/2)$"
+ "The ideal $0$-$\\pi$ circuit has an identical pair of capacitors, an identical pair of linear inductors and an identical pair of Josephson junctions (including paracitic capacitances). The circuit has three modes: a transmon-like $\\theta$-mode, a fluxonium-like $\\phi$-mode and a spurious harmonic oscillator $\\zeta$-mode. When is no disorder (asymmetry) in the capacitor pairs or the inductor pairs, the $\\zeta$-mode is decoupled from the rest two. When the small disorder in the junction capacitances and junction energies are taken into account in first order, the Hamiltonian for the $0$-$\\pi$ circuit decoupled from the $\\zeta$-mode is\n",
+ "\\begin{align*}\n",
+ "H_{\\phi,\\theta}&=-2E_\\text{CJ}\\partial_\\phi^2+2E_{\\text{C}\\Sigma}(i\\partial_\\theta-n_g)^2-2E_\\text{J}\\cos\\theta\\cos(\\phi-\\varphi_\\text{ext}/2)+E_L\\phi^2+2E_\\text{J} \\\\\n",
+ "&+2E_{C\\Sigma}dC_J\\,\\partial_\\phi\\partial_\\theta + E_J dE_J \\sin\\theta\\sin(\\phi-\\phi_\\text{ext}/2),\n",
+ "\\end{align*}\n",
+ "where $\\varphi_{\\text{ext}} = 2\\pi\\Phi_{\\text{ext}}/\\Phi_0$ is the reduced external magnetic flux, the diorder of parasitic capacitances and junction energies are defined as $dC_J = 2(C_{J1} - C_{J2})/(C_{J1}+C_{J2})$ and $dE_J = 2(E_{J1} - E_{J2})/(E_{J1}+E_{J2})$.\n",
+ "\n",
+ "
\n",
+ "\n",
+ "**Creation via GUI** (ipywidgets needs to be installed for this to work.)"
]
},
{
"cell_type": "code",
- "execution_count": 2,
+ "execution_count": 21,
"metadata": {
"ExecuteTime": {
"end_time": "2020-03-27T13:04:05.513875Z",
@@ -62,7 +77,7 @@
{
"data": {
"application/vnd.jupyter.widget-view+json": {
- "model_id": "52b838faf6db4771a6e9f94f695622d1",
+ "model_id": "272ebf4df0a5423f8dc35aaafc756be9",
"version_major": 2,
"version_minor": 0
},
@@ -76,7 +91,7 @@
{
"data": {
"application/vnd.jupyter.widget-view+json": {
- "model_id": "dc7e8efa167241e192f053a2a75faee8",
+ "model_id": "c01e02e4e1234a458314feff3780aaae",
"version_major": 2,
"version_minor": 0
},
@@ -93,15 +108,18 @@
]
},
{
+ "attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
- "Diagonlization of zero-pi proceeds in a hybrid basis, using charge basis for $\\theta$ and discretization over a final interval for $\\phi$. (The latter explains the need for providing grid parameters.)"
+ "**Programmatic creation**\n",
+ "\n",
+ "The diagonlization of $0$-$\\pi$ proceeds in a hybrid basis, using the charge basis for $\\theta$ and discretization over an interval for $\\phi$. (The latter explains the need for providing grid parameters.)"
]
},
{
"cell_type": "code",
- "execution_count": 3,
+ "execution_count": 22,
"metadata": {
"ExecuteTime": {
"end_time": "2020-03-27T12:55:37.604003Z",
@@ -111,7 +129,8 @@
"outputs": [],
"source": [
"zero_pi = scq.ZeroPi(\n",
- " grid = scq.Grid1d(-6*np.pi, 6*np.pi, 200),\n",
+ " # reminder: the parameters for generating a 1D grid are (min_value, max_value, num_grid_points)\n",
+ " grid = scq.Grid1d(-6*np.pi, 6*np.pi, 200), \n",
" EJ = 10.0,\n",
" EL = 0.04,\n",
" ECJ = 20.0,\n",
@@ -124,19 +143,14 @@
},
{
"cell_type": "code",
- "execution_count": 4,
- "metadata": {
- "ExecuteTime": {
- "end_time": "2020-03-27T13:04:09.028466Z",
- "start_time": "2020-03-27T13:04:09.021450Z"
- }
- },
+ "execution_count": 23,
+ "metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
- "ZeroPi--------------|\n",
+ "ZeroPi--------------| [ZeroPi_4]\n",
" | EJ: 10.0\n",
" | EL: 0.04\n",
" | ECJ: 20.0\n",
@@ -157,19437 +171,70 @@
"print(zero_pi)"
]
},
+ {
+ "attachments": {},
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "Just like other qubits implemented in scqubits, parameters of $0$-$\\pi$ can be modified by either assigning values to the corresponding attributes, or through modifying values in the above GUI."
+ ]
+ },
{
"cell_type": "code",
- "execution_count": 5,
- "metadata": {
- "ExecuteTime": {
- "end_time": "2020-02-07T03:22:25.523435Z",
- "start_time": "2020-02-07T03:22:25.274049Z"
- }
- },
+ "execution_count": 24,
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "zero_pi.flux = 0.31"
+ ]
+ },
+ {
+ "attachments": {},
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "An interesting alternative way to specify capacitive energies is to provide $E_{CJ}$ and $E_{C\\Sigma}$ (the latter corresponds to the optional argument `ECS`) during the initialization. The $E_C$ value can also be changed by providing an $E_{C\\Sigma}$ value in the following way:"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 26,
+ "metadata": {},
"outputs": [
{
"data": {
- "image/svg+xml": [
- "\r\n",
- "\r\n",
- "\r\n",
- "\r\n"
- ],
"text/plain": [
- "