diff --git a/examples/demo_transmon_qubit_qiskit_metal_interfaced.ipynb b/examples/demo_transmon_qubit_qiskit_metal_interfaced.ipynb
new file mode 100644
index 0000000..e9d53af
--- /dev/null
+++ b/examples/demo_transmon_qubit_qiskit_metal_interfaced.ipynb
@@ -0,0 +1,4825 @@
+{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {
+ "id": "EuGcWuEZZCIK"
+ },
+ "source": [
+ "The following tutorial is based on Koch et al. (2007) PRA where the physics context is described. It models the transmon qubit in the cooper-pair charge basis, assuming wrapped junction phase variable."
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {
+ "id": "iE0Cjg0nWBSw"
+ },
+ "source": [
+ "#Import key modules for this demo"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 1,
+ "metadata": {
+ "id": "8RKXGlZvHuGp"
+ },
+ "outputs": [],
+ "source": [
+ "%load_ext autoreload\n",
+ "%autoreload 2\n",
+ "%config IPCompleter.greedy = True\n",
+ "%matplotlib inline\n",
+ "%config Completer.use_jedi = False\n",
+ "%config InlineBackend.figure_format = 'svg'"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 7,
+ "metadata": {
+ "colab": {
+ "base_uri": "https://localhost:8080/"
+ },
+ "id": "qoAOt7LRKlNZ",
+ "outputId": "38bf78f4-a14d-4b00-b5d2-8eef0921762b"
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Requirement already satisfied: PySide2 in /usr/local/lib/python3.11/dist-packages (5.13.2)\n",
+ "Requirement already satisfied: shiboken2==5.13.2 in /usr/local/lib/python3.11/dist-packages (from PySide2) (5.13.2)\n"
+ ]
+ }
+ ],
+ "source": [
+ "!pip install PySide2\n",
+ "!pip install qiskit-metal"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 11,
+ "metadata": {
+ "id": "0YOEc4VjO7QT"
+ },
+ "outputs": [],
+ "source": [
+ "import os\n",
+ "\n",
+ "# Set this environment variable to prevent qiskit-metal from trying to set up a Qt backend\n",
+ "os.environ[\"QISKIT_METAL_HEADLESS\"] = \"1\""
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 12,
+ "metadata": {
+ "id": "e-eHuv1PO7S9"
+ },
+ "outputs": [],
+ "source": [
+ "# Now import qiskit_metal\n",
+ "import qiskit_metal"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 15,
+ "metadata": {
+ "id": "YmvJTBQ3O7Ve"
+ },
+ "outputs": [],
+ "source": [
+ "from qiskit_metal.analyses.hamiltonian.transmon_charge_basis import Hcpb\n",
+ "from qiskit_metal.analyses.hamiltonian.transmon_CPB_analytic import Hcpb_analytic\n",
+ "import pandas as pd\n",
+ "import matplotlib.pyplot as plt\n",
+ "import numpy as np\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 74,
+ "metadata": {
+ "id": "QpRuTrajapEO"
+ },
+ "outputs": [],
+ "source": [
+ "%matplotlib inline\n",
+ "%config InlineBackend.figure_format = 'svg'\n",
+ "\n",
+ "import numpy as np\n",
+ "import scqubits as scq"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {
+ "id": "ZMh9LZ6JbZ-I"
+ },
+ "source": [
+ "#The Hamiltonian"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {
+ "id": "W1u0TH73WuXf"
+ },
+ "source": [
+ "The Hamiltonian of the transmon qubit in the can be written in the charge basis as:"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {
+ "id": "qReRvMBJX2ah"
+ },
+ "source": [
+ "\\begin{align}\n",
+ " H = 4E_C(\\hat{n} - n_g)^2 - \\frac{1}{2}E_J\\sum_n\\left(\n",
+ " \\left| n \\right \\rangle \\left \\langle n+1 \\right | + \\text{h.c.} \\right)\n",
+ "\\end{align}"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 76,
+ "metadata": {
+ "colab": {
+ "base_uri": "https://localhost:8080/"
+ },
+ "id": "lxBDWrwTcwy6",
+ "outputId": "b2b64eff-53af-47ff-bcfd-d3ed0d38562a"
+ },
+ "outputs": [
+ {
+ "name": "stderr",
+ "output_type": "stream",
+ "text": [
+ "WARNING:py.warnings:Warning: Starting with v3.2, scqubits uses the optional package 'ipyuetify' for graphical user interfaces. To use this functionality, add the package via `conda install -c conda-forge ipyvuetify` or `pip install ipyvuetify`.\n",
+ "For use with jupyter lab, additionally execute `jupyter labextension install jupyter-vuetify`.\n",
+ "\n",
+ " /usr/local/lib/python3.11/dist-packages/scqubits/utils/misc.py: 143\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Transmon------------| [Transmon_9]\n",
+ " | EJ: 15.0\n",
+ " | EC: 0.3\n",
+ " | ng: 0.0\n",
+ " | ncut: 30\n",
+ " | truncated_dim: 10\n",
+ " |\n",
+ " | dim: 61\n",
+ "\n"
+ ]
+ }
+ ],
+ "source": [
+ "tmon = scq.Transmon.create()\n",
+ "print(tmon)"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 79,
+ "metadata": {
+ "id": "AX8Vj7EZcw2R"
+ },
+ "outputs": [],
+ "source": [
+ "x = np.linspace(-2.0,2.0,101) # this represents the charging energy (ng)\n",
+ "H_norm = Hcpb(nlevels=2, Ej=1000.0, Ec=1000.0, ng=0.5) # Hamiltonian definition\n",
+ "norm = H_norm.fij(0,1) # normalization constant"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 80,
+ "metadata": {
+ "id": "5qaCI49Zapnw"
+ },
+ "outputs": [],
+ "source": [
+ "E0, E1, E2 = [], [], []\n",
+ "\n",
+ "# For a given value of offset charge (ng, represented by x) we will calculate the CPB Hamiltonian using the previously assigned values of E_J and E_C. Then we calculate the eigenvalue for a given value of m.\n",
+ "for i in x:\n",
+ " H = Hcpb(nlevels=30, Ej=15.0, Ec=0.3, ng=i)\n",
+ " E0.append(H.evalue_k(0)/norm)\n",
+ " E1.append(H.evalue_k(1)/norm)\n",
+ " E2.append(H.evalue_k(2)/norm)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {
+ "id": "STp-uA8laevC"
+ },
+ "source": [
+ "#Verifying Orthonormality of the Wavefunctions\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "Qiskit metal is used to show orthonormality of wavefunctions."
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 81,
+ "metadata": {
+ "colab": {
+ "base_uri": "https://localhost:8080/"
+ },
+ "id": "YFkasdgOad-7",
+ "outputId": "c52e5b87-5ad4-4315-9b98-5c1ca8a152c7"
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "(8.326672684688674e-17-7.392060725770952e-18j)\n",
+ "(0.9999999999999996+0j)\n",
+ "(0.9999999999999998+0j)\n"
+ ]
+ }
+ ],
+ "source": [
+ "Psi0, theta0 = H.psi_k(0)\n",
+ "Psi1, theta1 = H.psi_k(1)\n",
+ "print(np.dot(Psi0,Psi1.conj()))\n",
+ "print(np.dot(Psi0, Psi0.conj()))\n",
+ "print(np.dot(Psi1, Psi1.conj()))"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {
+ "id": "UocxZpEnhFIO"
+ },
+ "source": [
+ "#Charge dispersion"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {
+ "id": "VunqiRmbcAUp"
+ },
+ "source": [
+ "The peak-to-peak value of the charge dispersion for the mth energy level is given by the expression: $\\epsilon_m = E_m(n_g=0.5)-E_m(n_g=0.0)$. We can plot $\\epsilon_m/E_{01}$ as a function of $E_J/E_C$ for the first few energy levels and reproduce the figure published in Phys. Rev. A 76, 042319 (2007) (Figure 4(a)). We can start by defining a value of charging energy and creating empty lists for $\\epsilon_0$ through $\\epsilon_4$"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 83,
+ "metadata": {
+ "id": "dypU9-Yab0s0"
+ },
+ "outputs": [],
+ "source": [
+ "E_c=100.0 # charging energy\n",
+ "epsilon0, epsilon1, epsilon2, epsilon3 = [], [], [], [] # charge dispersion for m=0 through m=4\n",
+ "x = np.linspace(1,140,101)"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {
+ "id": "ga7GZViWbPcS"
+ },
+ "source": [
+ "#Anharmonicity"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {
+ "id": "4T74-QzHj9J-"
+ },
+ "source": [
+ "We know that for the transmon qubit, having the Josephson Energy much larger than the charging energy ($E_J>>E_C$) results in a decrease in anharmonicity. The latter is critical for a functional qubit in which the energy difference between the lowest two states ($E_{01}$) is sufficiently different than the energy difference between the second and third states, ($E_{12}$). The absolute anharmonicity is defined as $\\alpha = E_{12}-E_{01}$, while the relative anharmonicity is defined as\n",
+ ".\n",
+ "\n",
+ "We can easily make a plot of the anharmonicity as a function of $E_J/E_C$ using the Hcpb class. Let’s have the ratio of $E_J/E_C$ (which we’ll call x) vary from 0 to 80, and then we’ll create empty lists for $\\alpha$ and $\\alpha_r$\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 82,
+ "metadata": {
+ "id": "-bKdEjF-WtST"
+ },
+ "outputs": [],
+ "source": [
+ "x = np.linspace(0,80,101) #EJ/EC\n",
+ "alpha = []\n",
+ "alpha_r = []"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 84,
+ "metadata": {
+ "id": "i6fXf09UWtXc"
+ },
+ "outputs": [],
+ "source": [
+ "for i in x:\n",
+ " H_anharm = Hcpb(nlevels=15, Ej=i*E_c, Ec=E_c, ng=0.5)\n",
+ " alpha.append(H_anharm.anharm())\n",
+ " alpha_r.append(H_anharm.anharm()/H_anharm.fij(0,1))"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 85,
+ "metadata": {
+ "colab": {
+ "base_uri": "https://localhost:8080/",
+ "height": 458
+ },
+ "id": "iA_iKSoqbnfe",
+ "outputId": "9598e78b-85f9-4545-b33f-e4860d86fcc6"
+ },
+ "outputs": [
+ {
+ "data": {
+ "text/plain": [
+ "Text(0, 0.5, 'alpha_r')"
+ ]
+ },
+ "execution_count": 85,
+ "metadata": {},
+ "output_type": "execute_result"
+ },
+ {
+ "data": {
+ "image/svg+xml": [
+ "\n",
+ "\n",
+ "\n"
+ ],
+ "text/plain": [
+ ""
+ ]
+ },
+ "metadata": {},
+ "output_type": "display_data"
+ }
+ ],
+ "source": [
+ "plt.figure(1)\n",
+ "plt.subplot(131)\n",
+ "plt.plot(x,alpha)\n",
+ "plt.xlabel(\"Ej/Ec\")\n",
+ "plt.ylabel(\"alpha\")\n",
+ "plt.subplot(133)\n",
+ "plt.plot(x,alpha_r)\n",
+ "plt.ylim(-0.2, 1.0)\n",
+ "plt.xlabel(\"Ej/Ec\")\n",
+ "plt.ylabel(\"alpha_r\")"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {
+ "id": "oRYWjpV7cUxt"
+ },
+ "source": [
+ "#Dephasing Time (T2)"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {
+ "id": "gdEHEA0wcYPL"
+ },
+ "source": [
+ "We can estimate the qubit dephasing time (T2) due to charge noise by the following expression: $T_2 = \\frac{\\hbar}{A\\pi |\\epsilon_1|}$ where $A$ is on the order of $1E-4$\n",
+ " according to Phys. Rev. A 76, 042319 (2007). Since this is essentially just the inverse of the charge dispersion for $\\epsilon_1$, we can easily calculate T2 as a function of $E_J/E_C$ with the following:"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 86,
+ "metadata": {
+ "id": "o1k7C88pbnh6"
+ },
+ "outputs": [],
+ "source": [
+ "x = np.linspace(0,80,101) # ratio of Ej/Ec, varying from 0 to 80\n",
+ "T2 = [] # empty list for T2"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 87,
+ "metadata": {
+ "colab": {
+ "base_uri": "https://localhost:8080/",
+ "height": 453
+ },
+ "id": "j52M1m_-bnkp",
+ "outputId": "d5099a5a-32ff-462d-b418-cc922cc4c242"
+ },
+ "outputs": [
+ {
+ "data": {
+ "text/plain": [
+ "Text(0, 0.5, 'T2 (sec)')"
+ ]
+ },
+ "execution_count": 87,
+ "metadata": {},
+ "output_type": "execute_result"
+ },
+ {
+ "data": {
+ "image/svg+xml": [
+ "\n",
+ "\n",
+ "\n"
+ ],
+ "text/plain": [
+ ""
+ ]
+ },
+ "metadata": {},
+ "output_type": "display_data"
+ }
+ ],
+ "source": [
+ "E_c = 1000.0\n",
+ "for i in x:\n",
+ " H_half = Hcpb(nlevels=15, Ej=i*E_c, Ec=E_c, ng=0.5)\n",
+ " H_zero = Hcpb(nlevels=15, Ej=i*E_c, Ec=E_c, ng=0.0)\n",
+ " eps = abs(H_half.evalue_k(1) - H_zero.evalue_k(1))\n",
+ " T2.append(1.0/(2.0*(1E-4)*(1E6)*eps) )\n",
+ "\n",
+ "plt.plot(x, T2)\n",
+ "plt.yscale(\"log\")\n",
+ "plt.xlabel(\"Ej/Ec\")\n",
+ "plt.ylabel(\"T2 (sec)\")"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {
+ "id": "FF2_ML3uh19q"
+ },
+ "source": [
+ "Operator matrix elements visualized with text representation of each entry."
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 117,
+ "metadata": {
+ "colab": {
+ "base_uri": "https://localhost:8080/",
+ "height": 417
+ },
+ "id": "_txRAJZlQMCL",
+ "outputId": "6a7278d1-9556-4f84-9333-59bdc9846213"
+ },
+ "outputs": [
+ {
+ "data": {
+ "image/svg+xml": [
+ "\n",
+ "\n",
+ "\n"
+ ],
+ "text/plain": [
+ ""
+ ]
+ },
+ "metadata": {},
+ "output_type": "display_data"
+ }
+ ],
+ "source": [
+ "tmon.plot_matrixelements('cos_phi_operator', evals_count=10, show3d=False, show_numbers=True);\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "id": "KolbsH0XigV1"
+ },
+ "outputs": [],
+ "source": []
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "id": "GcmFLUX0QMEl"
+ },
+ "outputs": [],
+ "source": []
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 15,
+ "metadata": {
+ "id": "RSJolMAoHxSd"
+ },
+ "outputs": [],
+ "source": []
+ }
+ ],
+ "metadata": {
+ "colab": {
+ "provenance": []
+ },
+ "kernelspec": {
+ "display_name": "Python 3",
+ "name": "python3"
+ },
+ "language_info": {
+ "name": "python"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 0
+}