EigenmodeSim

class EigenmodeSim(design: QDesign | None = None, renderer_name: str = 'hfss')[source]

Compute eigenmode, then derive from it using the epr method.

Default Setup:
  • name (str): Name of eigenmode setup. Defaults to “Setup”.

  • min_freq_ghz (int): Minimum frequency in GHz. Defaults to 1.

  • max_delta_f (float): Absolute value of maximum difference in

    frequency. Defaults to 0.5.

  • max_passes (int): Maximum number of passes. Defaults to 10.

  • min_passes (int): Minimum number of passes. Defaults to 1.

  • min_converged (int): Minimum number of converged passes. Defaults to 1.

  • pct_refinement (int): Percent refinement. Defaults to 30.

  • basis_order (int): Basis order. Defaults to 1.

  • vars (Dict): Variables (key) and values (value) to define in the renderer.

Data Labels:
  • convergence_f (pd.DataFrame): Convergence of the eigenmode frequency.

  • convergence_t (pd.DataFrame): Convergence of the eigenmode frequency.

Compute eigenmode, then derive from it using the epr method.

Parameters:
  • design (QDesign) – Pointer to the main qiskit-metal design. Used to access the QRenderer. Defaults to None.

  • renderer_name (str, optional) – Which renderer to use. Defaults to ‘hfss’.

Attributes

convergence_f

Getter

Returns:

Convergence of the eigenmode frequency.

Return type:

pd.DataFrame

convergence_t

Getter

Returns:

Convergence of the eigenmode frequency.

Return type:

pd.DataFrame

data_labels = ['convergence_t', 'convergence_f']

Default data labels.

default_setup = {'basis_order': 1, 'max_delta_f': 0.5, 'max_passes': 10, 'min_converged': 1, 'min_freq_ghz': 1, 'min_passes': 1, 'n_modes': 1, 'pct_refinement': 30, 'vars': {'Cj': '0 fF', 'Lj': '10 nH'}}

Default setup.

logger

Returns the logger.

renderer_initialized

Reports whether the renderer is initialized or stopped.

setup

Dictionary intended to be used to modify the analysis behavior.

Returns:

Current setup.

Return type:

Dict

Type:

Getter

sim_setup_name

Getter

Returns:

Name of the setup being executed.

Return type:

str

supported_data

Set that contains the names of the variables supported from the analysis.

Returns:

list of supported variable names.

Return type:

set

Type:

Getter

Methods

clear_data(data_name: str | list | None = None)

Clear data. Can optionally specify one or more labels to delete those labels and data.

Parameters:

data_name (Union[str, list], optional) – Can list specific labels to clean. Defaults to None.

clear_fields(names: list | None = None)[source]

Delete field plots from renderer.

Parameters:

names (list, optional) – Names of field plots to delete. Defaults to None.

close()

Stops the renderer by executing the routine of the selected renderer.

compute_convergences(variation: str | None = None)[source]

Convergence plots are computed as part of run(). However, in special cases you might need to recalculate them using a different variation.

Parameters:

variation (str, optional) – Information from pyEPR; variation should be in the form variation = “scale_factor=’1.2001’”. Defaults to None.

get_data(data_name: str | None = None)

Retrieves the analysis module data. Returns None if nothing is found.

Parameters:

data_name (str, optional) – Label to query for data. If not specified, the entire dictionary is returned. Defaults to None.

Returns:

The data associated with the label, or the entire list of labels and data.

Return type:

Any

get_data_labels() list

Retrieves the list of data labels currently set. Returns None if nothing is found.

Returns:

list of data names

Return type:

list

plot_convergences(convergence_t: DataFrame | None = None, convergence_f: DataFrame | None = None, fig: Figure | None = None, _display: bool = True)[source]

Creates 3 plots, useful to determin the convergence achieved by the renderer: * convergence frequency vs. pass number if fig is None. * delta frequency and solved elements vs. pass number. * delta frequency vs. solved elements.

Parameters:
  • convergence_t (pd.DataFrame) – Convergence vs pass number of the eigenemode freqs.

  • convergence_f (pd.DataFrame) – Convergence vs pass number of the eigenemode freqs.

  • fig (matplotlib.figure.Figure, optional) – A mpl figure. Defaults to None.

  • _display (bool, optional) – Display the plot? Defaults to True.

plot_fields(object_name, eigenmode: int = 1, *args, **kwargs)[source]

Plots electro(magnetic) fields in the renderer. Accepts as args everything parameter accepted by the homonymous renderer method.

Parameters:
  • object_name (str) – Used to plot on faces of.

  • eigenmode (int, optional) – ID of the mode you intend to plot. Defaults to 1.

Returns:

None

print_run_args()

Prints the args and kwargs that were used in the last run() of this Analysis instance.

run(*args, **kwargs)

Alias for run_sim() necessary to implement super-class method, while preventing method name collision when sim and non-sim QAnalysis classes are inherited.

run_sim(name: str | None = None, components: list | None = None, open_terminations: list | None = None, port_list: list | None = None, jj_to_port: list | None = None, ignored_jjs: list | None = None, box_plus_buffer: bool = True) Tuple[str, str][source]

Executes the entire eigenmode analysis and convergence result export. First it makes sure the tool is running. Then it does what’s necessary to render the design. Finally it runs the setup defined in this class. So you need to modify the setup ahead. You can modify the setup by using the methods defined in the QAnalysis super-class. After this method concludes you can inspect the output using this class properties.

Parameters:
  • name (str) – reference name for the components selection. If None, it will use the design.name. Defaults to None.

  • components (Union[list, None], optional) – List of components to render. Defaults to None.

  • open_terminations (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, optional) – Either calculate a bounding box based on the location of rendered geometries or use chip size from design class. Defaults to True.

Returns:

Name of the design and name of the setup.

Return type:

(str, str)

run_sweep(*args, **kwargs)

User requests sweeper based on arguments from Sweeper.run_sweep().

save_run_args(**kwargs)

Intended to be used to store the kwargs passed to the run() method, for repeatability and for later identification of the QAnalysis instance.

save_screenshot()

Saves the screenshot.

Returns:

Path to png formatted screenshot.

Return type:

(pathlib.WindowsPath)

select_renderer(renderer_name: str)

Makes sure the renderer exists in qiskit-metal. If yes it sets the analysis class variables to be able to reach it easily. Else it throws an error.

Parameters:

renderer_name (str) – Name of the renderer you intend to use.

Returns:

The renderer to be used in the analysis.

Return type:

(QRenderer)

set_data(data_name: str, data: Any)

Stores data in a structure for later retrieval. Could be output, intermediate or even input data. Current implementation uses Dict()

Parameters:
  • data_name (str) – Label for the data. Used a storage key.

  • data (Any) – Free format

setup_update(section: str | None = None, **kwargs)

Intended to modify multiple setup settings at once, while retaining previous settings. If you intend to change a single setting, the better way is: setup.setting1 = value.

Parameters:

section (str) – Setup section that contains the setup keys to update.

start()

Starts the renderer by executing the routine of the selected renderer.