Skip to content

Commit

Permalink
hi
Browse files Browse the repository at this point in the history
  • Loading branch information
GirgisF committed Feb 19, 2024
1 parent d01d16e commit 95b80d0
Show file tree
Hide file tree
Showing 15 changed files with 5,753 additions and 0 deletions.
Binary file added .DS_Store
Binary file not shown.
Binary file added src/.DS_Store
Binary file not shown.
Binary file added src/notebooks/.DS_Store
Binary file not shown.
1,758 changes: 1,758 additions & 0 deletions src/notebooks/scqubits1/00-cqq.ipynb

Large diffs are not rendered by default.

File renamed without changes.
1,719 changes: 1,719 additions & 0 deletions src/notebooks/scqubits1/03_cavity_biased_qubits.ipynb

Large diffs are not rendered by default.

2,116 changes: 2,116 additions & 0 deletions src/notebooks/scqubits1/cqq.ipynb

Large diffs are not rendered by default.

99 changes: 99 additions & 0 deletions src/notebooks/scqubits1/experiment_one.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
"import numpy as np \n",
"import qutip as qt\n",
"import matplotlib as plt\n",
"from quantum_logical.pulsesim.mode import QubitMode\n",
"from quantum_logical.scqubits.modes import Modes\n",
"from quantum_logical.scqubits.hamiltonian import Hamiltonian\n",
"from quantum_logical.scqubits.system import System"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [],
"source": [
"#dimensionality of the cavity \n",
"N = 10\n",
"\n",
"\n",
"qubit1 = Modes(type='qubit',Ej = 3, Ec = 1)\n",
"qubit1.mode_build\n",
"\n",
"qubit2 = Modes(type='qubit',Ej = 3, Ec = 1)\n",
"qubit2.mode_build\n",
"\n",
"cavity = Modes(type='cavity', E_osc=3, dim = N)\n",
"cavity.mode_build\n",
"\n",
"#creating a list of the modes\n",
"qmmodes = [qubit1, qubit2, cavity]\n",
"\n"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {},
"outputs": [
{
"ename": "AttributeError",
"evalue": "'Hamiltonian' object has no attribute 'type'",
"output_type": "error",
"traceback": [
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[0;31mAttributeError\u001b[0m Traceback (most recent call last)",
"Cell \u001b[0;32mIn[3], line 7\u001b[0m\n\u001b[1;32m 3\u001b[0m hamiltonian\u001b[38;5;241m.\u001b[39mhilbertspace_build\n\u001b[1;32m 5\u001b[0m \u001b[38;5;66;03m#building the hamiltonian\u001b[39;00m\n\u001b[1;32m 6\u001b[0m \u001b[38;5;66;03m#static terms \u001b[39;00m\n\u001b[0;32m----> 7\u001b[0m \u001b[43mhamiltonian\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mstatic\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\n",
"File \u001b[0;32m~/Desktop/Quantum_logical_updated/quantum_logical/src/quantum_logical/scqubits/hamiltonian.py:22\u001b[0m, in \u001b[0;36mHamiltonian.static\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m 20\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mH \u001b[38;5;241m=\u001b[39m \u001b[38;5;241m0\u001b[39m\n\u001b[1;32m 21\u001b[0m \u001b[38;5;28;01mfor\u001b[39;00m i \u001b[38;5;129;01min\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mmodes:\n\u001b[0;32m---> 22\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m(\u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mtype\u001b[49m \u001b[38;5;241m==\u001b[39m \u001b[38;5;124m'\u001b[39m\u001b[38;5;124mqubit\u001b[39m\u001b[38;5;124m'\u001b[39m):\n\u001b[1;32m 23\u001b[0m order[i] \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mEj \u001b[38;5;241m*\u001b[39m scq\u001b[38;5;241m.\u001b[39mTransmon\u001b[38;5;241m.\u001b[39mn_operator\n\u001b[1;32m 24\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m(\u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mtype \u001b[38;5;241m==\u001b[39m \u001b[38;5;124m'\u001b[39m\u001b[38;5;124mcavity\u001b[39m\u001b[38;5;124m'\u001b[39m \u001b[38;5;129;01mor\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mtype \u001b[38;5;241m==\u001b[39m \u001b[38;5;124m'\u001b[39m\u001b[38;5;124moscillator\u001b[39m\u001b[38;5;124m'\u001b[39m):\n",
"\u001b[0;31mAttributeError\u001b[0m: 'Hamiltonian' object has no attribute 'type'"
]
}
],
"source": [
"#sending the modes to make the hamiltonian \n",
"hamiltonian = Hamiltonian(qmmodes)\n",
"hamiltonian.hilbertspace_build\n",
"\n",
"#building the hamiltonian\n",
"#static terms \n",
"hamiltonian.static()\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "venv",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.12"
}
},
"nbformat": 4,
"nbformat_minor": 2
}
Empty file.
Binary file added src/quantum_logical/.DS_Store
Binary file not shown.
Empty file.
29 changes: 29 additions & 0 deletions src/quantum_logical/scqubits/hamiltonian.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
"""building the hamiltonian for the system"""

import abc as ABC
import numpy as np
from quantum_logical.scqubits.modes import Modes
import scqubits as scq
import qutip as qt

class Hamiltonian(Modes):
def __init__(self, modes):
#takes in quantum modes and builds the hamiltonian
self.modes = modes

def hilbertspace_build(self):
scq.HilbertSpace(self.modes)
return 0

def static(self):
order = [i for i in self.modes]
self.H = 0
for i in self.modes:
if(isinstance(i,Modes)):
order[i] = self.Ej * scq.Transmon.n_operator
if(isinstance == 'cavity' or self.type == 'oscillator'):
order[i] = self.E_osc * scq.Oscillator.n_operator
for w in order:
self.H += w


22 changes: 22 additions & 0 deletions src/quantum_logical/scqubits/modes.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
"""file that will be used to create the individual modes"""
import numpy as np
import abc as ABC
import scqubits as scq

class Modes:
def __init__(self, **kwargs):
#defining all of the useful variables
self.type = kwargs["type"]

def mode_build(self, **kwargs):
if(self.type == 'qubit'):
self.Ej = kwargs["Ej"]
self.Ec = kwargs["Ec"]
self.ng = kwargs["ng"]
self.ncut = kwargs["ncut"]
scq.Transmon(self.Ej,self.Ec,self.ng, self.ncut)
if(self.type == 'cavity' or self.type == 'oscillator'):
self.E_osc = kwargs["E_osc"]
self.dim = kwargs["dim"]
scq.Oscillator(self.E_osc, truncated_dim=self.dim)

10 changes: 10 additions & 0 deletions src/quantum_logical/scqubits/system.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import numpy as np
import abc as ABC
#from quantum_logical.scqubits.modes import Modes
import scqubits as scq

class System:
def __init__(self, **kwargs):
self, modes = list[Modes]
def create_space(modes):
scq.hilbertspace(modes)

0 comments on commit 95b80d0

Please sign in to comment.