LumpedElementsSim¶
- class LumpedElementsSim(design: QDesign | None = None, renderer_name: str = 'q3d')[source]¶
Compute Capacitance matrix using the selected renderer.
- Default Setup:
name (str): Name of capacitive simulation setup. Defaults to “Setup”.
freq_ghz (int): Frequency in GHz. Defaults to 5.
save_fields (bool): Whether or not to save fields. Defaults to False.
enabled (bool): Whether or not setup is enabled. Defaults to True.
max_passes (int): Maximum number of passes. Defaults to 15.
min_passes (int): Minimum number of passes. Defaults to 2.
- min_converged_passes (int): Minimum number of converged passes.
Defaults to 2.
percent_error (float): Error tolerance as a percentage. Defaults to 0.5.
percent_refinement (int): Refinement as a percentage. Defaults to 0.5.
- auto_increase_solution_order (bool): Whether or not to increase
solution order automatically. Defaults to True.
solution_order (str): Solution order. Defaults to ‘High’.
solver_type (str): Solver type. Defaults to ‘Iterative’.
- Data Labels:
cap_matrix (pd.DataFrame): Capacitance matrix from the last iteration.
units (str): Units of the values in ‘cap_matrix’ and ‘cap_all_passess’.
cap_all_passes (list of pd.DataFrame): intermediate value, for inspection.
Initialize the class to extract the capacitance matrix.
- 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 ‘q3d’.
Attributes
- capacitance_all_passes¶
Getter
- Returns:
- of pd.DataFrame. For each pass of the incremental mash refinements,
it retains the capacitance matrix at that pass.
- Return type:
dict
- capacitance_matrix¶
Getter
- Returns:
Capacitance matrix data, typically generated by run_sim().
- Return type:
pd.DataFrame
- data_labels = ['cap_matrix', 'cap_all_passes', 'units', 'is_converged']¶
Default data labels.
- default_setup = {'auto_increase_solution_order': True, 'enabled': True, 'freq_ghz': 5.0, 'max_passes': 15, 'min_converged_passes': 2, 'min_passes': 2, 'percent_error': 0.5, 'percent_refinement': 30, 'save_fields': False, 'solution_order': 'High', 'solver_type': 'Iterative'}¶
Default setup.
- is_converged¶
Getter
- Returns:
Boolean indicating whether simulation has converged
- Return type:
bool
- 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
- units¶
Getter
- Returns:
Capacitance matrix units.
- 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_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
- 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, box_plus_buffer: bool = True) Tuple[str, str] [source]¶
Executes the capacitance matrix extraction. First it makes sure the tool is running. Then it does the 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.
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:
- 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.