qdesignoptimizer.design_analysis module

Core class for managing, optimizing and analyzing quantum circuit designs using electromagnetic simulations.

class qdesignoptimizer.design_analysis.DesignAnalysis(state: DesignAnalysisState, mini_study: MiniStudy, opt_targets: List[OptTarget] | None = None, save_path: str = 'analysis_result', update_design_variables: bool = True, plot_settings: dict | None = None, meshing_map: List[MeshingMap] | None = None, minimization_tol=1e-12)[source]

Bases: object

Manager for quantum circuit design optimization and electromagnetic simulation.

Handles the workflow of:

  • Simulation setup for eigenmode and capacitance calculations

  • Parameter extraction from simulations

  • Design variable optimization based on physical targets

  • Result tracking and visualization

This class integrates HFSS/ANSYS simulations with Qiskit Metal designs to automate the optimization of superconducting circuit parameters.

Parameters:
  • state (DesignAnalysisState) – State object containing design, render function, and target parameters.

  • mini_study (MiniStudy) – Simulation parameters including component names, modes, and passes.

  • opt_targets (List[OptTarget]) – List of target physical parameters to optimize and their design variable relationships.

  • save_path (str) – Location to save optimization results.

  • update_design_variables (bool) – Whether to automatically update design files with optimized values.

  • plot_settings (dict) – Configuration for progress visualization plots.

  • meshing_map (List[MeshingMap]) – Custom mesh refinement configurations for specific components.

  • minimization_tol (float) – tolerance used to terminate the solution of an optimization step.

update_nbr_passes(nbr_passes: int)[source]

Update the number of simulation passes.

update_nbr_passes_capacitance_ministudies(nbr_passes: int)[source]

Updates the number of passes for capacitance matrix studies.

update_delta_f(delta_f: float)[source]

Update eigenmode convergence tolerance.

update_var(updated_design_vars: dict, system_optimized_params: dict)[source]

Update junction and design variables in mini_study, design, pinfo and.

get_fine_mesh_names()[source]

The fine mesh for the eigenmode study of HFSS can be set in two different ways. First, via an attribute in the component class with function name “get_meshing_names”. This function should return the list of part names, e.g. {name}_flux_line_left. The second option is to specify the part names via the meshing_map as keyword in the DesginAnalysis class.

get_port_gap_names()[source]

Get names of all endcap ports in the design.

run_eigenmodes()[source]

Simulate eigenmodes.

run_epr()[source]

Run EPR, requires design with junctions.

get_simulated_modes_sorted()[source]

Get simulated modes sorted on value.

Returns:

list of modes sorted on freq_value

Return type:

List[tuple]

static get_parameter_value(target: OptTarget, system_params: dict) float[source]

Return value of parameter from target specification.

get_system_params_targets_met() dict[str, float][source]

Return organized dictionary of parameters given target specifications and current status.

optimize_target(updated_design_vars_input: dict, system_optimized_params: dict)[source]

Run full optimization iteration to adjust design variables toward target parameters.

Performs these steps in sequence:

  1. Updates design variables and system parameters

  2. Runs eigenmode simulation to extract frequencies and decay rates

  3. Performs energy participation ratio (EPR) analysis for nonlinearities

  4. Executes capacitance matrix studies if configured

  5. Saves results and generates visualization plots

Parameters:
  • updated_design_vars_input (dict) – Manual design variable overrides

  • system_optimized_params (dict) – Manual system parameter overrides

Note

Assumes modes are simulated in the same order as target frequencies for correct assignment. Mismatched orders will cause incorrect parameter mapping.

overwrite_parameters()[source]

Overwirte the original design_variables.json file with new values.

get_cross_kerr_matrix(iteration: int = -1) DataFrame | None[source]

Get cross kerr matrix from EPR analysis.

Parameters:

iteration (int) – simulation iteration number defaults to the most recent iteration

Returns:

cross kerr matrix

Return type:

pd.DataFrame

get_eigenmode_results(iteration: int = -1) DataFrame | None[source]

Get eigenmode results.

Parameters:

iteration (int) – simulation iteration number defaults to the most recent iteration

Returns:

eigenmode results

Return type:

pd.DataFrame

get_capacitance_matrix(capacitance_study_number: int, iteration: int = -1) DataFrame | None[source]

Get capacitance matrix from stati simulation.

Parameters:
  • capacitance_study_number (int) – which of the capacitance studies in the MiniStudy to retrive the matrix from (1 being the first)

  • iteration (int) – simulation iteration number defaults to the most recent iteration

Returns:

capacitance matrix

Return type:

List[pd.DataFrame]

screenshot(gui, run=None)[source]

Take and save a screenshot of the current qiskit-metal design.

Useful for tracking how the geometry is updated during optimization.