Skip to content

Commit

Permalink
Add dissipative elements as arguments to ProjectInfo (#103)
Browse files Browse the repository at this point in the history
  • Loading branch information
nikosavola committed Mar 24, 2022
1 parent e13dae4 commit dfd1f63
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 7 deletions.
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,14 +104,16 @@ pinfo.junctions['jBob'] = {'Lj_variable':'Lj_bob', 'rect':'rect_bob', 'lin
pinfo.validate_junction_info() # Check that valid names of variables and objects have been supplied.

# 2b. Dissipative elements: specify
pinfo.dissipative['dielectrics_bulk'] = ['si_substrate', 'dielectic_object2'] # supply names of hfss objects
pinfo.dissipative['dielectrics_bulk'] = ['si_substrate', 'dielectric_object2'] # supply names of hfss objects
pinfo.dissipative['dielectric_surfaces'] = ['interface1', 'interface2']
# Alternatively, these could be specified in ProjectInfo with
# pinfo = epr.ProjectInfo(..., dielectrics_bulk = ['si_substrate', 'dielectric_object2'])

# 3. Perform microwave analysis on eigenmode solutions
eprd = epr.DistributedAnalysis(pinfo)
if 1: # automatic reports
eprd.quick_plot_frequencies(swp_var) # plot the solved frequencies before the analysis
eprd.hfss_report_full_convergence() # report convergen
eprd.hfss_report_full_convergence() # report convergence
eprd.do_EPR_analysis()

# 4a. Perform Hamiltonian spectrum post-analysis, building on mw solutions using EPR
Expand Down
16 changes: 15 additions & 1 deletion _tutorial_notebooks/Tutorial 1. Startup example.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -867,7 +867,21 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"The Q is infinite, since we have not included dissipation yet in this example. The row index is the mode number"
"The Q is infinite, since we have not included dissipation yet in this example. The row index is the mode number. Dissipation can be modelled by selecting the corresponding HFSS objects for solids, sheets, and seams when initialising `ProjectInfo`. For example,\n",
"```python\n",
"pinfo = epr.ProjectInfo(project_path = path_to_project, \n",
" project_name = 'pyEPR_tutorial1',\n",
" design_name = '1. single_transmon',\n",
" dielectrics_bulk = ['si_substrate'],\n",
" dielectric_surfaces = ['interface'],\n",
" resistive_surfaces = None,\n",
" seams = None)\n",
"```\n",
"or after the fact with\n",
"```python\n",
"pinfo.dissipative['dielectrics_bulk'] = ['si_substrate']\n",
"pinfo.dissipative['dielectric_surfaces'] = ['interface']\n",
"```"
]
},
{
Expand Down
6 changes: 4 additions & 2 deletions docs/source/examples_quick.rst
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,16 @@ succinctly plotted.
pinfo.validate_junction_info() # Check that valid names of variables and objects have been supplied.
# 2b. Dissipative elements: specify
pinfo.dissipative['dielectrics_bulk'] = ['si_substrate', 'dielectic_object2'] # supply names of hfss objects
pinfo.dissipative['dielectrics_bulk'] = ['si_substrate', 'dielectric_object2'] # supply names of hfss objects
pinfo.dissipative['dielectric_surfaces'] = ['interface1', 'interface2']
# Alternatively, these could be specified in ProjectInfo with
# pinfo = epr.ProjectInfo(..., dielectrics_bulk = ['si_substrate', 'dielectric_object2'])
# 3. Perform microwave analysis on eigenmode solutions
eprd = epr.DistributedAnalysis(pinfo)
swp_var = 'Lj_alice' # Sweep variable from optimetric analysis that should be used on the x axis for the frequency plot
eprd.quick_plot_frequencies(swp_var) # plot the solved frequencies before the analysis
eprd.hfss_report_full_convergence() # report convergen
eprd.hfss_report_full_convergence() # report convergence
eprd.do_EPR_analysis()
# 4a. Perform Hamiltonian spectrum post-analysis, building on mw solutions using EPR
Expand Down
2 changes: 1 addition & 1 deletion pyEPR/core_distributed_analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def __init__(self, *args, **kwargs):
Use notes:
-------------------
* If you change the setup or number of eignemodes in HFSS, etc.
* If you change the setup or number of eigenmodes in HFSS, etc.
call `update_ansys_info()`
Expand Down
15 changes: 14 additions & 1 deletion pyEPR/project_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,10 @@ def __init__(self,
project_name: str = None,
design_name: str = None,
setup_name: str = None,
dielectrics_bulk: list[str] = None,
dielectric_surfaces: list[str] = None,
resistive_surfaces: list[str] = None,
seams: list[str] = None,
do_connect: bool = True):
"""
Keyword Arguments:
Expand All @@ -179,7 +183,14 @@ def __init__(self,
Defaults to ``None``, which will get the current active one.
setup_name (str) : Name of the setup within the design.
Defaults to ``None``, which will get the current active one.
dielectrics_bulk (list(str)) : List of names of dielectric bulk objects.
Defaults to ``None``.
dielectric_surfaces (list(str)) : List of names of dielectric surfaces.
Defaults to ``None``.
resistive_surfaces (list(str)) : List of names of resistive surfaces.
Defaults to ``None``.
seams (list(str)) : List of names of seams.
Defaults to ``None``.
do_connect (bool) [additional]: Do create connection to Ansys or not? Defaults to ``True``.
"""
Expand All @@ -198,6 +209,8 @@ def __init__(self,

# Dissipative HFSS volumes and surfaces
self.dissipative = self._Dissipative()
for opt in diss_opt:
self.dissipative[opt] = locals()[opt]
self.options = config.ansys

# Connected to HFSS variable
Expand Down

0 comments on commit dfd1f63

Please sign in to comment.