ScatteringImpedanceSim

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

Uses drivenmodal simulation to extract the impedance.

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

  • freq_ghz (int): Frequency in GHz. Defaults to 5.

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

    scattering parameter S. Defaults to 0.1.

  • 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.

  • sweep_setup (Dict): Description of the drivenmodal sweep
    • name (str): Name of sweep. Defaults to “Sweep”.

    • start_ghz (float): Starting frequency of sweep in GHz. Defaults to 2.0.

    • stop_ghz (float): Ending frequency of sweep in GHz. Defaults to 8.0.

    • count (int): Total number of frequencies. Defaults to 101.

    • step_ghz (float): Difference between adjacent frequencies. Defaults to None.

    • type (str): Type of sweep. Defaults to “Fast”.

    • save_fields (bool): Whether or not to save fields. Defaults to False.

Data Labels:
  • sweep_name (str): Name given to the current sweep.

  • param_z (pd.DataFrame): Impedance matrix.

  • param_y (pd.DataFrame): Admittance matrix.

  • param_s (pd.DataFrame): Scattering matrix.

Compute drivenmodal and then extracts impedance, admittance and scattering paramters.

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

data_labels = ['sweep_name', 'params_z', 'params_y', 'params_s']

Default data labels.

default_setup = {'basis_order': 1, 'freq_ghz': 5, 'max_delta_s': 0.1, 'max_passes': 10, 'min_converged': 1, 'min_passes': 1, 'pct_refinement': 30, 'sweep_setup': {'count': 101, 'name': 'Sweep', 'save_fields': False, 'start_ghz': 2.0, 'step_ghz': None, 'stop_ghz': 8.0, 'type': 'Fast'}, 'vars': {'Cj': '0 fF', 'Lj': '10 nH'}}

Default setup.

logger

Returns the logger.

param_s

Getter

Returns:

Scattering matrix.

Return type:

str

param_y

Getter

Returns:

Admittance matrix.

Return type:

str

param_z

Getter

Returns:

Impedance matrix.

Return type:

str

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

sweep_name

Getter

Returns:

Name of the sweep being executed.

Return type:

str

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.

close()

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

get_admittance(param_name: list = ['Y11', 'Y21'])[source]

Create the impedance plot.

Parameters:

param_name (list) – List of strings describing which admittance values to return. Defaults to [‘Y11’, ‘Y21’].

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

get_impedance(param_name: list = ['Z11', 'Z21'])[source]

Create the impedance plot.

Parameters:

param_name (list) – List of strings describing which impedance values to return. Defaults to [‘Z11’, ‘Z21’].

get_scattering(param_name: list = ['S11', 'S21'])[source]

Create the scattering plot.

Parameters:

param_name (list) – List of strings describing which scattering values to return. Defaults to [‘S11’, ‘S21’].

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 drivenmodal 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 and sweep defined in this class. 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. Format element: (component_name, pin_name, impedance (float)). Defaults to None.

  • jj_to_port (Union[list, None], optional) – List of tuples of jj’s to be rendered as ports. Format element: (component_name(str), element_name(str), impedance(float), draw_ind(bool)). If draw_ind=True, a 10nH Inductance is draw, else it is omitted. 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.