QHFSSRenderer#
- class QHFSSRenderer(design: QDesign, initiate=True, options: Dict = None)[source]#
Subclass of QAnsysRenderer for running HFSS simulations.
- QAnsysRenderer Default Options:
Lj: ‘10nH’ – Lj has units of nanoHenries (nH)
Cj: 0 – Cj must be 0 for pyEPR analysis! Cj has units of femtofarads (fF)
_Rj: 0 – _Rj must be 0 for pyEPR analysis! _Rj has units of Ohms
max_mesh_length_jj: ‘7um’ – Maximum mesh length for Josephson junction elements
max_mesh_length_port: ‘7um’ – Maximum mesh length for Ports in Eigenmode Simulations
project_path: None – Default project path; if None –> get active
project_name: None – Default project name
design_name: None – Default design name
ansys_file_extension: ‘.aedt’ – Ansys file extension for 2016 version and newer
x_buffer_width_mm: 0.2 – Buffer between max/min x and edge of ground plane, in mm
y_buffer_width_mm: 0.2 – Buffer between max/min y and edge of ground plane, in mm
Create a QRenderer for HFSS simulations, subclassed from QAnsysRenderer.
- Parameters:
design (QDesign) – Use QGeometry within QDesign to obtain elements for Ansys.
initiate (bool, optional) – True to initiate the renderer. Defaults to True.
options (Dict, optional) – Used to override all options. Defaults to None.
Attributes
- NAME_DELIM = '_'#
Name delimiter
- default_options = {'Cj': 0, 'Lj': '10nH', '_Rj': 0, 'design_name': None, 'max_mesh_length_jj': '7um', 'max_mesh_length_port': '7um', 'plot_ansys_fields_options': {'AdjacentSidePlot': 'False', 'FullModelPlot': 'False', 'IntrinsicVar': "Phase='0deg'", 'PlotFolder': 'E Field', 'PlotGeomInfo_0': '1', 'PlotGeomInfo_1': 'Surface', 'PlotGeomInfo_2': 'FacesList', 'PlotGeomInfo_3': '1', 'QuantityName': 'Mag_E', 'StreamlinePlot': 'False', 'UserSpecifyFolder': '0', 'UserSpecifyName': '0', 'name': 'NAME:Mag_E1'}, 'project_name': None, 'project_path': None, 'wb_offset': '0um', 'wb_size': 5, 'wb_threshold': '400um', 'x_buffer_width_mm': 0.2, 'y_buffer_width_mm': 0.2}#
Default options
- default_setup = {'drivenmodal': {'basis_order': '1', 'freq_ghz': '5.0', 'max_delta_s': '0.1', 'max_passes': '10', 'min_converged': '1', 'min_passes': '1', 'name': 'Setup', 'pct_refinement': '30'}, 'eigenmode': {'basis_order': '-1', 'max_delta_f': '0.5', 'max_passes': '10', 'min_converged': '1', 'min_freq_ghz': '1', 'min_passes': '1', 'n_modes': '1', 'name': 'Setup', 'pct_refinement': '30'}, 'port_inductor_gap': '10um', 'q3d': {'auto_increase_solution_order': 'True', 'enabled': 'True', 'freq_ghz': '5.0', 'max_passes': '15', 'min_converged_passes': '2', 'min_passes': '2', 'name': 'Setup', 'percent_error': '0.5', 'percent_refinement': '30', 'save_fields': 'False', 'solution_order': 'High', 'solver_type': 'Iterative'}}#
Default setup.
- design#
Return a reference to the parent design object.
- element_extensions = {}#
Element extensions dictionary
- element_table_data = {'junction': {'capacitance': 0, 'inductance': '10nH', 'mesh_kw_jj': 7e-06, 'resistance': 0}, 'path': {'wire_bonds': False}}#
Element table data.
- hfss_options = {'port_inductor_gap': '10um'}#
HFSS Options
- initialized#
Returns True if initialized, False otherwise.
- logger#
Returns the logger.
- modeler#
The modeler from pyEPR HfssModeler.
- Returns:
Reference to design.HfssModeler in Ansys.
- Return type:
pyEPR.ansys.HfssModeler
- name = 'hfss'#
Name
- options#
Options for the QRenderer.
- pinfo#
pyEPR.ProjectInfo).
- Type:
Project info for Ansys renderer (class
- rapp#
- rdesktop#
Methods
- activate_ansys_design(design_name: str, solution_type: str | None = None)#
Select a design with the given name from the open project. If the design exists, that will be added WITHOUT altering the suffix of the design name.
- Parameters:
name (str) – Name of the new Ansys design
- activate_ansys_setup(setup_name: str)#
For active design, either get existing setup, make new setup with name, or make new setup with default name.
- Parameters:
setup_name (str, optional) – If name exists for setup, then have pinfo reference it. If name for setup does not exist, create a new setup with the name. If name is None, create a new setup with default name.
- activate_drivenmodal_design(name: str = 'MetalHFSSDrivenModal')[source]#
(deprecated) use activate_ansys_design()
- activate_drivenmodal_setup(setup_name_activate: str | None = None)[source]#
(deprecated) use activate_ansys_setup()
- activate_eigenmode_design(name: str = 'MetalHFSSEigenmode')[source]#
(deprecated) use activate_ansys_design()
- activate_eigenmode_setup(setup_name_activate: str | None = None)[source]#
(deprecated) use activate_ansys_setup()
- add_drivenmodal_design(name: str, connect: bool = True)[source]#
(deprecated) use new_ansys_design()
- add_drivenmodal_setup(name: str | None = None, freq_ghz: int | None = None, max_delta_s: float | None = None, max_passes: int | None = None, min_passes: int | None = None, min_converged: int | None = None, pct_refinement: int | None = None, basis_order: int | None = None, *args, **kwargs)[source]#
Create a solution setup in Ansys HFSS Driven Modal. If user does not provide arguments, they will be obtained from default_setup dict.
- Parameters:
name (str, optional) – Name of driven modal setup. Defaults to None.
freq_ghz (int, optional) – Frequency in GHz. Defaults to None.
max_delta_s (float, optional) – Absolute value of maximum difference in scattering parameter S. Defaults to None.
max_passes (int, optional) – Maximum number of passes. Defaults to None.
min_passes (int, optional) – Minimum number of passes. Defaults to None.
min_converged (int, optional) – Minimum number of converged passes. Defaults to None.
pct_refinement (int, optional) – Percent refinement. Defaults to None.
basis_order (int, optional) – Basis order. Defaults to None.
- add_eigenmode_setup(name: str | None = None, min_freq_ghz: int | None = None, n_modes: int | None = None, max_delta_f: float | None = None, max_passes: int | None = None, min_passes: int | None = None, min_converged: int | None = None, pct_refinement: int | None = None, basis_order: int | None = None, *args, **kwargs)[source]#
Create a solution setup in Ansys HFSS Eigenmode. If user does not provide arguments, they will be obtained from hfss_options dict.
- Parameters:
name (str, optional) – Name of eigenmode setup. Defaults to “Setup”.
min_freq_ghz (int, optional) – Minimum frequency in GHz. Defaults to 1.
n_modes (int, optional) – Number of modes. Defaults to 1.
max_delta_f (float, optional) – Maximum difference in freq between consecutive passes. Defaults to 0.5.
max_passes (int, optional) – Maximum number of passes. Defaults to 10.
min_passes (int, optional) – Minimum number of passes. Defaults to 1.
min_converged (int, optional) – Minimum number of converged passes. Defaults to 1.
pct_refinement (int, optional) – Percent refinement. Defaults to 30.
basis_order (int, optional) – Basis order. Defaults to -1.
- add_endcaps(open_pins: list | None = None)#
Create endcaps (rectangular cutouts) for all pins in the list open_pins and add them to chip_subtract_dict. Each element in open_pins takes on the form (component_name, pin_name) and corresponds to a single pin.
- Parameters:
open_pins (Union[list, None], optional) – List of tuples of pins that are open. Defaults to None.
- add_mesh()#
Add mesh to all elements in self.assign_mesh.
- add_message(msg: str, severity: int = 0)#
Add message to Message Manager box in Ansys.
- Parameters:
msg (str) – Message to add.
severity (int) – 0 = Informational, 1 = Warning, 2 = Error, 3 = Fatal.
- add_sweep(setup_name='Setup', start_ghz=2.0, stop_ghz=8.0, count=101, step_ghz=None, name='Sweep', type='Fast', save_fields=False)[source]#
Add a frequency sweep to a driven modal setup.
- Parameters:
setup_name (str, optional) – Name of driven modal simulation setup. Defaults to “Setup”.
start_ghz (float, optional) – Starting frequency of sweep in GHz. Defaults to 2.0.
stop_ghz (float, optional) – Ending frequency of sweep in GHz. Defaults to 8.0.
count (int, optional) – Total number of frequencies. Defaults to 101.
step_ghz (float, optional) – Difference between adjacent frequencies. Defaults to None.
name (str, optional) – Name of sweep. Defaults to “Sweep”.
type (str, optional) – Type of sweep. Defaults to “Fast”.
save_fields (bool, optional) – Whether or not to save fields. Defaults to False.
- add_table_data_to_QDesign(class_name: str)#
During init of renderer, this needs to happen. In particular, each renderer needs to update custom columns and values within QDesign.
- Parameters:
class_name (str) – Name from cls.name for each renderer.
- analyze_setup(setup_name: str)[source]#
Run a specific solution setup in Ansys HFSS.
- Parameters:
setup_name (str) – Name of setup.
- analyze_sweep(sweep_name: str, setup_name: str)[source]#
Analyze a single sweep within the setup.
- Parameters:
sweep_name (str) – Name of sweep to analyze.
setup_name (str) – Name of setup to analyze.
- auto_wirebonds(table)#
Adds wirebonds to the Ansys model for path elements where; subtract = True and wire_bonds = True.
Uses render options for determining of the: * wb_threshold – the minimum distance between two vertices of a path for a wirebond to be added. * wb_offset – offset distance for wirebond placement (along the direction of the cpw) * wb_size – controls the width of the wirebond (wb_size * path[‘width’])
- chip_designation_error()#
Warning message that appears when the Ansys renderer fails to locate a component’s chip designation. Provides instructions for a temporary workaround until the layer stack is finalized.
- chip_not_in_design_error(missing_chip: str)#
Warning message that appears when the Ansys renderer fails to locate a component’s chip designation in DesignPlanar (or any child of QDesign). Provides instructions for a temporary workaround until the layer stack is finalized.
- chip_not_main()#
Warning message that appears when a component’s chip designation is not ‘main’. As of 05/10/21, all chip designations should be ‘main’ until the layer stack is finalized. Provides instructions for a temporary workaround until the layer stack is finalized.
- clean_active_design()#
Remove all elements from Ansys Modeler.
- clear_fields(names: list)#
Delete field plots from modeler window in Ansys. Does not throw an error if names are missing.
Can give multiple names, for example: hfss.plot_ansys_delete([‘Mag_E1’, ‘Mag_E1_2’])
- Parameters:
names (list) – Names of plots to delete from modeler window.
- close()#
Alias of _close_renderer()
- Returns:
True
- Return type:
bool
- connect_ansys(project_path: str | None = None, project_name: str | None = None, design_name: str | None = None)#
If none of the optional parameters are provided: connects to the Ansys COM, then checks for, and grab if present, an active project, design, and design setup.
If the optional parameters are provided: if present, opens the project file and design in Ansys.
- Parameters:
project_path (str, optional) – Path without file name
project_name (str, optional) – File name (with or without extension)
design_name (str, optional) – Name of the default design to open from the project file
- connect_ansys_design(design_name: str | None = None)#
Used to switch between existing designs.
- Parameters:
design_name (str, optional) – Name within the active project. Defaults to None.
- create_ports(port_list: list)[source]#
Add ports and their respective impedances in Ohms to designated pins in port_list. Port_list is formatted as [(qcomp_0, pin_0, impedance_0), (qcomp_1, pin_1, impedance_1), …].
- Parameters:
port_list (list) – List of tuples of pins to be rendered as ports.
- disconnect_ansys()#
Disconnect Ansys.
- distributed_analysis()[source]#
Returns class containing info on Hamiltonian parameters from HFSS simulation.
- Returns:
A class from pyEPR which does DISTRIBUTED ANALYSIS of layout and microwave results. It is the main computation class & interface with HFSS. This class defines a DistributedAnalysis object which calculates and saves Hamiltonian parameters from an HFSS simulation. It allows one to calculate dissipation.
- Return type:
DistributedAnalysis
- edit_drivenmodal_setup(setup_args: Dict)[source]#
User can pass key/values to edit the setup for active driven modal setup.
- Parameters:
setup_args (Dict) – a Dict with possible keys/values.
- setup_args dict contents:
name (str, optional): Name of eigenmode setup. Defaults to “Setup”.
freq_ghz (int, optional): Minimum frequency in GHz. Defaults to 1.
max_passes (int, optional): Maximum number of passes. Defaults to 10.
pct_refinement (int, optional): Percent refinement. Defaults to 30.
basis_order (int, optional): Basis order. Defaults to -1 (1 is “Mixed Order”).
Note, that these three are currently NOT implemented: Ansys API named EditSetup not documented for HFSS, and self.pinfo.setup does not have all the property variables used for Setup. * max_delta_s (float, optional): Absolute value of maximum difference in scattering parameter S. Defaults to 0.1. * min_passes (int, optional): Minimum number of passes. Defaults to 1. * min_converged (int, optional): Minimum number of converged passes. Defaults to 1.
- edit_eigenmode_setup(setup_args: Dict)[source]#
User can pass key/values to edit the setup for active eigenmode setup.
- Parameters:
setup_args (Dict) – a Dict with possible keys/values.
- setup_args dict contents:
name (str, optional): Name of eigenmode setup. Defaults to “Setup”.
min_freq_ghz (int, optional): Minimum frequency in GHz. Defaults to 1.
n_modes (int, optional): Number of modes. Defaults to 1.
max_delta_f (float, optional): Maximum difference in freq between consecutive passes. Defaults to 0.5.
max_passes (int, optional): Maximum number of passes. Defaults to 10.
pct_refinement (int, optional): Percent refinement. Defaults to 30.
basis_order (int, optional): Basis order. Defaults to -1.
Note, that these two are currently NOT implemented: Ansys API named EditSetup not documented for HFSS, and self.pinfo.setup does not have all the property variables used for Setup. * min_passes (int, optional): Minimum number of passes. Defaults to 1. * min_converged (int, optional): Minimum number of converged passes. Defaults to 1.
- epr_get_frequencies(junctions: dict | None = None, dissipatives: dict | None = None) DataFrame #
Returns all frequencies and quality factors vs a variation. It also initializes the systems for the epr analysis in terms of junctions and dissipatives
- Parameters:
junctions (dict, optional) – Each element of this dictionary describes one junction. Defaults to dict().
dissipatives (dict, optional) – Each element of this dictionary describes one dissipative. Defaults to dict().
- Returns:
multi-index, frequency and quality factors for each variation point.
- Return type:
pd.DataFrame
- epr_get_stored_energy(junctions: dict | None = None, dissipatives: dict | None = None)#
Computes the energy stored in the system pinfo must have a valid list of junctions and dissipatives to compute the energy stored in the system. So please provide them here, or using epr_start()
- Parameters:
junctions (dict, optional) – Each element of this dictionary describes one junction. Defaults to dict().
dissipatives (dict, optional) – Each element of this dictionary describes one dissipative. Defaults to dict().
- Returns:
energy_elec, energy_elec_substrate, energy_mag
- Return type:
(float, float, float)
- epr_report_hamiltonian(swp_variable: str = 'variation', numeric=True)#
Reports in a markdown friendly table the hamiltonian results.
- Parameters:
swp_variable (str, optional) – Variable against which we swept. Defaults to ‘variation’.
- epr_run_analysis(junctions: dict | None = None, dissipatives: dict | None = None)#
Executes the EPR analysis pinfo must have a valid list of junctions and dissipatives to compute the energy stored in the system. So please provide them here, or using epr_start()
- Parameters:
junctions (dict, optional) – Each element of this dictionary describes one junction. Defaults to dict().
dissipatives (dict, optional) – Each element of this dictionary describes one dissipative. Defaults to dict().
- epr_spectrum_analysis(cos_trunc: int = 8, fock_trunc: int = 7)#
Core epr analysis method.
- Parameters:
cos_trunc (int, optional) – truncation of the cosine. Defaults to 8.
fock_trunc (int, optional) – truncation of the fock. Defaults to 7.
- epr_start(junctions: dict | None = None, dissipatives: dict | None = None)#
Use to initialize the epr analysis package by first identifying which are the junctions, their electrical properties and their reference plane; then initialize the DistributedAnalysis package, which can execute microwave analysis on eigenmode results.
- Parameters:
junctions (dict, optional) – Each element of this dictionary describes one junction. Defaults to dict().
dissipatives (dict, optional) – Each element of this dictionary describes one dissipative. Defaults to dict().
- execute_design(design_name: str, solution_type: str, vars_to_initialize: Dict, force_redraw: bool = False, **design_selection) str #
It wraps the render_design() method to 1. skip rendering if the “selection” of components is left empty (re-uses selected design) 2. force design clearing and redraw if force_Redraw is set
- Parameters:
design_name (str) – Name to assign to the renderer design
solution_type (str) – eigenmode, capacitive or drivenmodal
vars_to_initialize (Dict) – Variables to initialize, i.e. Ljx, Cjx
force_redraw (bool, optional) – Force re-render the design. Defaults to False.
- Returns:
- final design name (a suffix might have been added to the provided name,
in case of conflicts)
- Return type:
str
- get_active_design_name()#
Returns the name of the Ansys Design Object
- Returns:
Name of the active Ansys Design
- Return type:
(str)
- get_all_Pparms_matrices(matrix_size: int) Tuple[DataFrame | None, DataFrame | None, DataFrame | None] [source]#
S = scattering matrix, Y = Admittance, Z= impedance.
matrix_size should be 1 or larger. This method will get the entire Scattering matrix based on matrix_size.
Example:’S21’ S matrix: SAB means, excite B, measure A
- get_chip_names() List[str] #
Obtain a list of chips on which the selection of components, if valid, resides.
- Returns:
Chips to render.
- Return type:
List[str]
- get_convergences(variation: str | None = None)[source]#
Get convergence for convergence_t, convergence_f, and text from GUI for solution data.
- Parameters:
variation (str, optional) – Information from pyEPR; variation should be in the form
None. (variation = "scale_factor='1.2001'". Defaults to) –
- Returns:
1st DataFrame: Convergence_t 2nd DataFrame: Convergence_f 3rd str: Text from GUI of solution data.
- Return type:
tuple[pandas.DataFrame, pandas.DataFrame, str]
- get_f_convergence(variation: str | None = None, save_csv: bool = True)[source]#
Create a report inside HFSS to plot the converge of frequency and style it. Saves report to csv file.
re(Mode(1)) [g] re(Mode(2)) [g] re(Mode(3)) [g] Pass [] 1 4.643101 4.944204 5.586289 2 5.114490 5.505828 6.242423 3 5.278594 5.604426 6.296777
- Parameters:
variation ('str', optional) – Information from pyEPR; variation should be in the form variation = “scale_factor=’1.2001’”. Defaults to None.
save_csv (bool, optional) – Save to file? Defaults to True.
- Returns:
Returns a convergence vs pass number of the eigenemode frequencies.
- Return type:
pd.DataFrame
- get_min_bounding_box() Tuple[float] #
Determine the max/min x/y coordinates of the smallest rectangular, axis-aligned bounding box that will enclose a selection of components to render, given by self.qcomp_ids. This method is only used when box_plus_buffer is True.
- Returns:
min x, min y, max x, and max y coordinates of bounding box.
- Return type:
Tuple[float]
- get_params(param_name: list | None = None)[source]#
Get one or more parameters (S, Y, or Z) as a function of frequency.
- Parameters:
param_name (Union[list, None], optional) – Parameters to obtain. Defaults to None.
- static get_renderer(name: str)#
Returns an already loaded and instantiated renderer.
- Parameters:
name (str) – rendering name
- Returns:
Renderer with the given name
- Return type:
- classmethod get_template_options(design: QDesign, render_template: Dict = None, logger_: Logger = None, template_key: str = None) Dict #
Creates template options for the Metal QRenderer class required for the class to function, based on the design template; i.e., be created, made, and rendered. Provides the blank option structure required.
The options can be extended by plugins, such as renderers.
- Parameters:
design (QDesign) – A design class.
render_template (Dict, optional) – Template options to overwrite the class ones. Defaults to None.
logger (logging.Logger, optional) – A logger for errors. Defaults to None.
template_key (str, optional) – The design.template_options key identifier. If None, then use _get_unique_class_name(). Defaults to None.
- Returns:
Dictionary of renderer’s default options based on design.template_options.
- Return type:
Dict
- get_unique_component_ids(highlight_qcomponents: list | None = None) Tuple[list, int] #
Confirm the list doesn’t have names of components repeated. Confirm that the name of component exists in QDesign. If QDesign doesn’t contain any component, or if all components in QDesign are found in highlight_qcomponents, return an empty list; otherwise return a list of unique components to be sent to the renderer. The second returned item, an integer, specifies which of these 3 cases applies.
- Parameters:
highlight_qcomponents (Union[list, None], optional) – Components to render. Defaults to None.
- Returns:
- Tuple: Empty or partial list of components in QDesign.
- int: 0 subset selected
1 every component selected 2 invalid
- Return type:
Tuple[list, int]
- initialize_cap_extract(**kwargs)#
Any task that needs to occur before running a simulation, such as creating a setup
- Returns:
Name of the setup that has been updated
- Return type:
str
- initialize_drivenmodal(sweep_setup: Dict, vars: Dict = {}, **kwargs)#
Any task that needs to occur before running a simulation, such as creating a setup
- Parameters:
sweep_setup (Dict) – list of parametric variables to set the frequency sweep.
vars (Dict, optional) – list of parametric variables to set in the renderer. Defaults to {}.
- Returns:
Name of the setup that has been updated
- Return type:
str
- initialize_eigenmode(vars: Dict = {}, **kwargs)#
Any task that needs to occur before running a simulation, such as creating a setup
- Parameters:
vars (Dict, optional) – list of parametric variables to set in the renderer. Defaults to {}.
- Returns:
Name of the setup that has been updated
- Return type:
str
- classmethod load()#
Load the renderer and register all its extensions. Only performed once.
Once complete, the renderer is added to the class attribute ‘__loaded_renderers__’ of QRenderer
- Returns:
True if success, otherwise throws an error.
- Return type:
bool
- new_ansys_design(design_name: str, solution_type: str, connect: bool = True)#
Add an Ansys design with the given name to the Ansys project. Valid solutions_type values are: ‘capacitive’ (q3d), ‘eignemode’ and ‘drivenmodal’ (hfss)
- Parameters:
design_name (str) – name of the Design to be created in Ansys
solution_type (str) – defines type of Design and solution to be created in Ansys
connect (bool, optional) – Should we connect qiskit-metal to this Ansy design? Defaults to True.
Returns(pyEPR.ansys.HfssDesign): The pointer to the design within Ansys.
- new_ansys_project()#
Creates a new empty project in Ansys.
- new_ansys_setup(name: str, **other_setup)#
Determines the appropriate setup to be created based on the pinfo.design.solution_type. make sure to set this variable before executing this method
- Parameters:
name (str) – name to give to the new setup
- Returns:
Pointer to the ansys setup object
- Return type:
pyEPR.ansys.HfssEMSetup
- open_ansys(path: str | None = None, executable: str = 'reg_ansysedt.exe', path_var: str = 'ANSYSEM_ROOT202')#
- Alternative method to open an Ansys session that allows to specify
which version to use. Default is version 2020 R2, but can be overridden.
- Parameters:
path (str) – Path to the Ansys executable. Defaults to None
executable (str) – Name of the ansys executable. Defaults to ‘reg_ansysedt.exe’
path_var (str) – Name of the OS environment variable that contains the path to the Ansys executable. Only used when path=None. Defaults to ‘ANSYSEM_ROOT202’ (Ansys ver. 2020 R2)
- parse_value(value: Any | List | Dict | Iterable) Any #
Same as design.parse_value. See design for help.
- Returns:
Parsed value of input.
- Return type:
object
- plot_ansys_delete(names: list)#
(deprecated) Use clear_fields()
- plot_ansys_fields(*args, **kwargs)#
(deprecated) use plot_fields()
- plot_convergences(variation: str | None = None, fig: Figure | None = None)[source]#
(deprecated) use EPRanalysis.plot_convergences()
- plot_fields(object_name: str, name: str | None = None, UserSpecifyName: int | None = None, UserSpecifyFolder: int | None = None, QuantityName: str | None = None, PlotFolder: str | None = None, StreamlinePlot: bool | None = None, AdjacentSidePlot: bool | None = None, FullModelPlot: bool | None = None, IntrinsicVar: str | None = None, PlotGeomInfo_0: int | None = None, PlotGeomInfo_1: str | None = None, PlotGeomInfo_2: str | None = None, PlotGeomInfo_3: int | None = None)#
Plot fields in Ansys. The options are populated by the component’s options.
- Parameters:
object_name (str) – Used to plot on faces of.
name (str, optional) – “NAME:<PlotName>” Defaults to None.
UserSpecifyName (int, optional) – 0 if default name for plot is used, 1 otherwise. Defaults to None.
UserSpecifyFolder (int, optional) – 0 if default folder for plot is used, 1 otherwise. Defaults to None.
QuantityName (str, optional) – Type of plot to create. Possible values are Mesh plots - “Mesh”; Field plots - “Mag_E”, “Mag_H”, “Mag_Jvol”, “Mag_Jsurf”,”ComplexMag_E”, “ComplexMag_H”, “ComplexMag_Jvol”, “ComplexMag_Jsurf”, “Vector_E”, “Vector_H”, “Vector_Jvol”, “Vector_Jsurf”, “Vector_RealPoynting”,”Local_SAR”, “Average_SAR”. Defaults to None.
PlotFolder (str, optional) – Name of the folder to which the plot should be added. Possible values are: “E Field”, “H Field”, “Jvol”, “Jsurf”, “SARField”, and “MeshPlots”. Defaults to None.
StreamlinePlot (bool, optional) – Passed to CreateFieldPlot. Defaults to None.
AdjacentSidePlot (bool, optional) – Passed to CreateFieldPlot. Defaults to None.
FullModelPlot (bool, optional) – Passed to CreateFieldPlot. Defaults to None.
IntrinsicVar (str, optional) – Formatted string that specifies the frequency and phase at which to make the plot. For example: “Freq=’1GHz’ Phase=’30deg’”. Defaults to None.
PlotGeomInfo_0 (int, optional) – 0th entry in list for “PlotGeomInfo:=”, <PlotGeomArray>. Defaults to None.
PlotGeomInfo_1 (str, optional) – 1st entry in list for “PlotGeomInfo:=”, <PlotGeomArray>. Defaults to None.
PlotGeomInfo_2 (str, optional) – 2nd entry in list for “PlotGeomInfo:=”, <PlotGeomArray>. Defaults to None.
PlotGeomInfo_3 (int, optional) – 3rd entry in list for “PlotGeomInfo:=”, <PlotGeomArray>. Defaults to None.
- Returns:
Return information from oFieldsReport.CreateFieldPlot(). The method CreateFieldPlot() always returns None.
- Return type:
NoneType
- plot_params(param_name: list | None = None)[source]#
Plot one or more parameters (S, Y, or Z) as a function of frequency. S = scattering matrix, Y = Admittance, Z= impedance.
- Parameters:
param_name (Union[list, None], optional) – Parameters to plot. Defaults to None.
- classmethod populate_element_extensions()#
Populate cls.element_extensions which will be used to create columns for tables in QGeometry tables.
The structure of cls.element_table_data should be same as cls.element_extensions.
- render_chip(chip_name: str, draw_sample_holder: bool)#
Render individual chips.
- Parameters:
chip_name (str) – Name of chip.
draw_sample_holder (bool) – Option to draw vacuum box around chip.
- render_chips(draw_sample_holder: bool = True, box_plus_buffer: bool = True)#
Render all chips containing components in self.qcomp_ids.
- Parameters:
draw_sample_holder (bool, optional) – Option to draw vacuum box around chip. Defaults to True.
box_plus_buffer (bool, optional) – Whether or not to use a box plus buffer. Defaults to True.
- render_component()#
Abstract method. Must be implemented by the subclass. Render the specified component.
- Parameters:
component (QComponent) – Component to render.
- render_components(table_type: str)#
Render components by breaking them down into individual elements.
- Parameters:
table_type (str) – Table type (poly, path, or junction).
- render_design(selection: list | None = None, open_pins: list | None = None, port_list: list | None = None, jj_to_port: list | None = None, ignored_jjs: list | None = None, box_plus_buffer: bool = True)[source]#
Initiate rendering of components in design contained in selection, assuming they’re valid. Components are rendered before the chips they reside on, and subtraction of negative shapes is performed at the very end. Add the metalize() method here to turn objects in self.assign_perfE (see init in QAnsysRenderer class) into perfect electrical conductors. Create lumped ports as needed.
First obtain a list of IDs of components to render and a corresponding case, denoted by self.qcomp_ids and self.case, respectively. If self.case == 1, all components in QDesign are to be rendered. If self.case == 0, a strict subset of components in QDesign are to be rendered. Otherwise, if self.case == 2, one or more component names in selection cannot be found in QDesign.
Among the components selected for export, there may or may not be unused (unconnected) pins. The second parameter, open_pins, contains tuples of the form (component_name, pin_name) that specify exactly which pins should be open rather than shorted during the simulation. Both the component and pin name must be specified because the latter could be shared by multiple components. All pins in this list are rendered with an additional endcap in the form of a rectangular cutout, to be subtracted from its respective plane.
In driven modal solutions, the Ansys design must include one or more ports. This is done by adding all port designations and their respective impedances in Ohms as (qcomp, pin, impedance) to port_list. Note that an open endcap must separate the two sides of each pin before inserting a lumped port in between, so behind the scenes all pins in port_list are also added to open_pins. Practically, however, port_list and open_pins are inputted as mutually exclusive lists.
Also in driven modal solutions, one may want to render junctions as lumped ports and/or inductors, or omit them altogether. To do so, tuples of the form (component_name, element_name, impedance, draw_ind) are added to the list jj_to_port. For example, (‘Q1’, ‘rect_jj’, 70, True) indicates that rect_jj of component Q1 is to be rendered as both a lumped port with an impedance of 70 Ohms as well as an inductor whose properties are given in default_options. Replacing the last entry of this 4-element tuple with False would indicate that only the port is to be drawn, not the inductor. Alternatively for driven modal solutions, one may want to disregard select junctions in the Metal design altogether to simulate the capacitive effect while keeping the qubit in an “off” state. Such junctions are specified in the form (component_name, element_name) in the list ignored_jjs.
The final parameter, box_plus_buffer, determines how the chip is drawn. When set to True, it takes the minimum rectangular bounding box of all rendered components and adds a buffer of x_buffer_width_mm and y_buffer_width_mm horizontally and vertically, respectively, to the chip size. The center of the chip lies at the midpoint x/y coordinates of the minimum rectangular bounding box and may change depending on which components are rendered and how they’re positioned. If box_plus_buffer is False, however, the chip position and dimensions are taken from the chip info dictionary found in self.design, irrespective of what’s being rendered. While this latter option is faster because it doesn’t require calculating a bounding box, it runs the risk of rendered components being too close to the edge of the chip or even falling outside its boundaries.
- Parameters:
selection (Union[list, None], optional) – List of components to render. Defaults to None.
open_pins (Union[list, None], optional) – List of tuples of pins that are open. Defaults to None.
port_list (Union[list, None], optional) – List of tuples of pins to be rendered as ports. Defaults to None.
jj_to_port (Union[list, None], optional) – List of tuples of jj’s to be rendered as ports. Defaults to None.
ignored_jjs (Union[list, None], optional) – List of tuples of jj’s that shouldn’t be rendered. Defaults to None.
box_plus_buffer (bool) – Either calculate a bounding box based on the location of rendered geometries or use chip size from design class.
- render_element(qgeom: Series, is_junction: bool)#
Render an individual shape whose properties are listed in a row of QGeometry table. Junction elements are handled separately from non- junction elements, as the former consist of two rendered shapes, not just one.
- Parameters:
qgeom (pd.Series) – GeoSeries of element properties.
is_junction (bool) – Whether or not qgeom belongs to junction table.
- render_element_junction(qgeom: Series)[source]#
Render a Josephson junction depending on the solution type.
- If in HFSS eigenmode, junctions are rendered as inductors consisting of
A rectangle of length pad_gap and width inductor_width. Defines lumped element RLC boundary condition.
A line that is later used to calculate the voltage in post-processing analysis.
If in HFSS driven modal, junctions can be inductors, lumped ports, both inductors and lumped ports, or omitted altogether. Ports are characterized by an impedance value given in the list jj_to_port when render_design() is called.
- Parameters:
qgeom (pd.Series) – GeoSeries of element properties.
- render_element_path(qgeom: Series)#
Render a path-type element.
- Parameters:
qgeom (pd.Series) – GeoSeries of element properties.
- render_element_poly(qgeom: Series)#
Render a closed polygon.
- Parameters:
qgeom (pd.Series) – GeoSeries of element properties.
- render_junction_inductor(qgeom: Series, xmin: float, xmax: float, ymin: float, ymax: float, z: float, axis: str)[source]#
Render a junction as an inductor with a bounding box given by xmin/xmax and ymin/ymax, a height z, and a horizontal or vertical axis.
- Parameters:
qgeom (pd.Series) – GeoSeries of element properties.
xmin (float) – Smallest x coordinate
xmax (float) – Largest x coordinate
ymin (float) – Smallest y coordinate
ymax (float) – Largest y coordinate
z (float) – z coordinate
axis (str) – Orientation, either ‘x’ or ‘y’
- render_junction_port(qgeom: Series, xmin: float, xmax: float, ymin: float, ymax: float, z: float, axis: str)[source]#
Render a junction as a port with a bounding box given by xmin/xmax and ymin/ymax, a height z, and a horizontal or vertical axis.
- Parameters:
qgeom (pd.Series) – GeoSeries of element properties.
xmin (float) – Smallest x coordinate
xmax (float) – Largest x coordinate
ymin (float) – Smallest y coordinate
ymax (float) – Largest y coordinate
z (float) – z coordinate
axis (str) – Orientation, either ‘x’ or ‘y’
- render_tables(skip_junction: bool = False)#
Render components in design grouped by table type (path, poly, or junction).
- save_screenshot(path: str | None = None, show: bool = True)#
Save the screenshot.
- Parameters:
path (str, optional) – Path to save location. Defaults to None.
show (bool, optional) – Whether or not to display the screenshot. Defaults to True.
- Returns:
path to png formatted screenshot.
- Return type:
pathlib.WindowsPath
- set_mode(mode: int, setup_name: str)[source]#
Set the eigenmode in pyEPR for a design with solution_type set to Eigenmode.
- Parameters:
mode (int) – Identify a mode from 1 to n_modes.
setup_name (str) – Select a setup from the active design.
- set_variables(variables: Dict)#
Fixes the junction properties before setup. This is necessary becasue the eigenmode analysis only considers the junction as a lumped CL element.
- Parameters:
variables (Dict) – dictionary of variables to set in Ansys. For example it could contain ‘Lj’: ‘10 nH’
- start(force=False)#
Call any initialization (single run) step required to setup the renderer for the first execution, such as connecting to some API or COM, or importing the correct material libraries, etc.
- Parameters:
force (bool) – If True, need to scrap the existing initialization and re-do If False, will start a new one only if none exists. Defaults to False.
- Returns:
is the renderer initialized successfully (thus usable?)
- Return type:
bool
- stop()#
Any calls that one may want to make after a rendering is complete.
- subtract_from_ground()#
For each chip, subtract all “negative” shapes residing on its surface if any such shapes exist.
- update_options(render_options: Dict | None = None, render_template: Dict | None = None)#
If template options has not been set for this renderer, then gather all the default options for children and add to design. The GUI would use this to store the template options.
Then give the template options to render to store in self.options. Then user can over-ride the render_options.
- Parameters:
render_options (Dict, optional) – If user wants to over-ride the template options. Defaults to None.
render_template (Dict, optional) – All the template options for each child. Defaults to None.