Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pyaedt renderer #935

Merged
merged 28 commits into from
Apr 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
6bd447e
Add the pyaedt renderers
priti-ashvin-shah-ibm Apr 19, 2023
99eadb5
Tutorials for renderers.
priti-ashvin-shah-ibm Apr 19, 2023
bd77376
Typos
priti-ashvin-shah-ibm Apr 19, 2023
a77eb25
A sample of a layer stack file.
priti-ashvin-shah-ibm Apr 19, 2023
2461ec5
Fix typos.
priti-ashvin-shah-ibm Apr 19, 2023
50f641c
Add files.
priti-ashvin-shah-ibm Apr 19, 2023
7af9321
Update imports due to changing repos.
priti-ashvin-shah-ibm Apr 19, 2023
c299874
Add new renderers to config file.
priti-ashvin-shah-ibm Apr 19, 2023
4ef8278
Looks like yapf linting has been changed, so needed to re-save these …
priti-ashvin-shah-ibm Apr 19, 2023
7981348
Add new renderers to test import.
priti-ashvin-shah-ibm Apr 19, 2023
282ae00
Update the import paths.
priti-ashvin-shah-ibm Apr 19, 2023
7195f0a
Reduce the errors in test cases.
priti-ashvin-shah-ibm Apr 19, 2023
bcaacad
Use same name as in renderers.
priti-ashvin-shah-ibm Apr 19, 2023
56c56d6
Update the files for new repo and documentation generation.
priti-ashvin-shah-ibm Apr 19, 2023
6dea759
Remove duplicate.
priti-ashvin-shah-ibm Apr 19, 2023
1e951bf
Add full path.
priti-ashvin-shah-ibm Apr 19, 2023
65a6b80
Check to see if this pyaedt API works.
priti-ashvin-shah-ibm Apr 19, 2023
16da43b
Give up on trying to find the type for pyaedt. Just use quotes.
priti-ashvin-shah-ibm Apr 19, 2023
c7a2e3f
Try this edit.
priti-ashvin-shah-ibm Apr 19, 2023
d92a8bf
For documentation, stop the circular import.
priti-ashvin-shah-ibm Apr 19, 2023
5acaacc
Fix Typo
priti-ashvin-shah-ibm Apr 19, 2023
5352b9e
Problem with registering the new renderers. The init has methods whic…
priti-ashvin-shah-ibm Apr 19, 2023
b0a6e22
Move the method to render_design, this will repeat the calculation, b…
priti-ashvin-shah-ibm Apr 20, 2023
e66ac5d
Add the renderers and see if they can pass CI.
priti-ashvin-shah-ibm Apr 20, 2023
6dc1144
Revert the change.
priti-ashvin-shah-ibm Apr 20, 2023
1fbcf9b
Fix the error while making columns for qgeometry table..
priti-ashvin-shah-ibm Apr 20, 2023
3e62e36
Update test case to include additional renderers.
priti-ashvin-shah-ibm Apr 20, 2023
f938df3
Added disclaimer for student license
AbeerVaishnav13 Apr 21, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
76 changes: 58 additions & 18 deletions qiskit_metal/analyses/quantization/lumped_capacitive.py
Original file line number Diff line number Diff line change
Expand Up @@ -263,8 +263,12 @@ def extract_transmon_coupled_Noscillator(capMatrix,

# sum of capacitances from each pad to ground
# this assumes the bus couplers are at "ground"
C1S = Cg[0] + np.sum(Cbus[0,])
C2S = Cg[1] + np.sum(Cbus[1,])
C1S = Cg[0] + np.sum(Cbus[
0,
])
C2S = Cg[1] + np.sum(Cbus[
1,
])

# total capacitance between pads
tCSq = Cs + C1S * C2S / (C1S + C2S) # Key equation
Expand All @@ -277,7 +281,11 @@ def extract_transmon_coupled_Noscillator(capMatrix,
(C1S+C2S) + np.sum(Cbus[:, ii]) + np.sum(Cbusbus[ii, :])

# qubit to coupling pad capacitance
tCqbus = (C2S * Cbus[0,] - Cbus[1,] * C1S) / (C1S + C2S)
tCqbus = (C2S * Cbus[
0,
] - Cbus[
1,
] * C1S) / (C1S + C2S)

# coupling pad to coupling pad capacitance
tCqbusbus = np.zeros([N, N])
Expand All @@ -287,7 +295,11 @@ def extract_transmon_coupled_Noscillator(capMatrix,
(Cbus[0, ii]+Cbus[1, ii])*(Cbus[0, jj]+Cbus[1, jj])/(C1S+C2S)

# voltage division ratio
bbus = (C2S * Cbus[0,] - Cbus[1,] * C1S) / ((C1S + C2S) * Cs + C1S * C2S)
bbus = (C2S * Cbus[
0,
] - Cbus[
1,
] * C1S) / ((C1S + C2S) * Cs + C1S * C2S)

# total qubit capacitance (including junction capacitance)
Cq = tCSq + CJ
Expand Down Expand Up @@ -471,16 +483,24 @@ def levels_vs_ng_real_units(Cq, IC, N=301, do_disp=0, do_plots=0):
plt.figure()
plt.subplot(1, 2, 1)
plt.plot(charge,
elvls[0,] / h / 1e9,
elvls[
0,
] / h / 1e9,
'k',
charge,
elvls[1,] / h / 1e9,
elvls[
1,
] / h / 1e9,
'b',
charge,
elvls[2,] / h / 1e9,
elvls[
2,
] / h / 1e9,
'r',
charge,
elvls[3,] / h / 1e9,
elvls[
3,
] / h / 1e9,
'g',
LineWidth=2)
plt.xlabel('Gate charge, n_g [2e]')
Expand All @@ -494,23 +514,43 @@ def levels_vs_ng_real_units(Cq, IC, N=301, do_disp=0, do_plots=0):
plt.figure(2)
plt.subplot(1, 2, 1)
plt.plot(
charge, 1000 * (elvls[2,] / h / 1e9 - elvls[0,] / h / 1e9 -
2 * elvls[1,] / h / 1e9 - elvls[0,] / h / 1e9),
charge, -charge * 0 - 1000 * Ec / h / 1e9)
charge, 1000 * (elvls[
2,
] / h / 1e9 - elvls[
0,
] / h / 1e9 - 2 * elvls[
1,
] / h / 1e9 - elvls[
0,
] / h / 1e9), charge, -charge * 0 - 1000 * Ec / h / 1e9)
plt.xlabel('Gate charge, n_g [2e]')
plt.ylabel('delta [MHZ] green theory, blue numerics ')
plt.subplot(1, 2, 2)
plt.plot(charge, elvls[1,] / h / 1e9 - elvls[0,] / h / 1e9, charge,
charge * 0 + (np.sqrt(8 * EJ * Ec) - Ec) / h / 1e9)
plt.plot(charge, elvls[
1,
] / h / 1e9 - elvls[
0,
] / h / 1e9, charge, charge * 0 + (np.sqrt(8 * EJ * Ec) - Ec) / h / 1e9)
plt.xlabel('Gate charge, n_g [2e]')
plt.ylabel('F01 [GHZ] green theory, blue numerics ')
plt.show()

fqubitGHz = np.mean(elvls[1,] / h / 1e9)
anharMHz = np.mean(1000 * (elvls[2,] / h / 1e9 - elvls[0,] / h / 1e9 -
2 * elvls[1,] / h / 1e9 - elvls[0,] / h / 1e9))

disp = np.max(-elvls[1,] / h + elvls[1, 0] / h)
fqubitGHz = np.mean(elvls[
1,
] / h / 1e9)
anharMHz = np.mean(1000 * (elvls[
2,
] / h / 1e9 - elvls[
0,
] / h / 1e9 - 2 * elvls[
1,
] / h / 1e9 - elvls[
0,
] / h / 1e9))

disp = np.max(-elvls[
1,
] / h + elvls[1, 0] / h)
tphi_ms = 2 / (2 * np.pi * disp * np.pi * 1e-4 * 1e-3)

if do_disp:
Expand Down
13 changes: 12 additions & 1 deletion qiskit_metal/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,18 @@
class_name='QGmshRenderer'),
elmer=Dict(path_name='qiskit_metal.renderers.renderer_elmer.elmer_renderer',
class_name='QElmerRenderer'),
)
aedt_q3d=Dict(
path_name=
'qiskit_metal.renderers.renderer_ansys_pyaedt.q3d_renderer_aedt',
class_name='QQ3DPyaedt'),
aedt_hfss_drivenmodal=Dict(
path_name=
'qiskit_metal.renderers.renderer_ansys_pyaedt.hfss_renderer_drivenmodal_aedt',
class_name='QHFSSDrivenmodalPyaedt'),
aedt_hfss_eigenmode=Dict(
path_name=
'qiskit_metal.renderers.renderer_ansys_pyaedt.hfss_renderer_eigenmode_aedt',
class_name='QHFSSEigenmodePyaedt'))
"""
Define the renderes to load. Just provide the module names here.
"""
Expand Down
4 changes: 2 additions & 2 deletions qiskit_metal/qgeometries/qgeometries_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -605,8 +605,8 @@ def delete_component_id(self, component_id: int):
for table_name in self.tables:
df_table_name = self.tables[table_name]
# self.tables[table_name] = df_table_name.drop(df_table_name[df_table_name['component'] == component_id].index)
self.tables[table_name] = df_table_name[
df_table_name['component'] != component_id]
self.tables[table_name] = df_table_name[df_table_name['component']
!= component_id]

def get_component(
self,
Expand Down
4 changes: 2 additions & 2 deletions qiskit_metal/qlibrary/core/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -249,8 +249,8 @@ def __init__(self,
short_name = prefix['short_name'][:name_trunc]
name_id = self.design._get_new_qcomponent_name_id(short_name)
# rename loop to make sure that no components manually named by the user conflicts
while self.design.rename_component(
self._id, short_name + "_" + str(name_id)) != 1:
while self.design.rename_component(self._id, short_name + "_" +
str(name_id)) != 1:
name_id = self.design._get_new_qcomponent_name_id(short_name)

# Add keys for each type of table. add_qgeometry() will update bool if the table is used.
Expand Down
8 changes: 4 additions & 4 deletions qiskit_metal/qlibrary/tlines/anchored_path.py
Original file line number Diff line number Diff line change
Expand Up @@ -314,13 +314,13 @@ def connect_simple(self, start_pt: QRoutePoint,
if (end_direction is None) or (mao.dot(end_direction,
corner2 - end) >= 0):
return np.expand_dims(corner2, axis=0)
if (mao.dot(start_direction, corner3 - start) >=
0) and startc3c4end:
if (mao.dot(start_direction, corner3 - start)
>= 0) and startc3c4end:
if (end_direction is None) or (mao.dot(end_direction,
corner4 - end) >= 0):
return np.vstack((corner3, corner4))
if (mao.dot(start_direction, corner5 - start) >=
0) and startc5c6end:
if (mao.dot(start_direction, corner5 - start)
>= 0) and startc5c6end:
if (end_direction is None) or (mao.dot(end_direction,
corner6 - end) >= 0):
return np.vstack((corner5, corner6))
Expand Down
12 changes: 11 additions & 1 deletion qiskit_metal/renderers/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,11 @@
QAnsysRenderer
QHFSSRenderer
QQ3DRenderer

QPyaedt
QQ3DPyaedt
QHFSSPyaedt
QHFSSDrivenmodalPyaedt
QHFSSEigenmodePyaedt



Expand Down Expand Up @@ -108,3 +112,9 @@

from .renderer_gmsh.gmsh_utils import Vec3DArray
from .renderer_gmsh.gmsh_renderer import QGmshRenderer

from .renderer_ansys_pyaedt.pyaedt_base import QPyaedt
from .renderer_ansys_pyaedt.q3d_renderer_aedt import QQ3DPyaedt
from .renderer_ansys_pyaedt.hfss_renderer_aedt import QHFSSPyaedt
from .renderer_ansys_pyaedt.hfss_renderer_drivenmodal_aedt import QHFSSDrivenmodalPyaedt
from .renderer_ansys_pyaedt.hfss_renderer_eigenmode_aedt import QHFSSEigenmodePyaedt
2 changes: 2 additions & 0 deletions qiskit_metal/renderers/renderer_ansys_pyaedt/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# -*- coding: utf-8 -*-
# """ Renderer using pyaedt and multiplanar using Ansys API."""
Loading