QDesign¶
- class QDesign(metadata: Optional[dict] = None, overwrite_enabled: bool = False, enable_renderers: bool = True)[source]¶
QDesign is the base class for Qiskit Metal Designs.
A design is the most top-level object in all of Qiskit Metal.
Create a new Metal QDesign.
- Parameters
metadata (Dict) – Dictionary of metadata. Defaults to None.
overwrite_enabled (bool) –
- When True - If the string name, used for component, already
exists in the design, the existing component will be deleted from design, and new component will be generated with the same name and newly generated component_id, and then added to design.
- When False - If the string name, used for component, already
exists in the design, the existing component will be kept in the design, and current component will not be generated, nor will be added to the design. The ‘NameInUse’ will be returned during component generation.
- Either True or False - If string name, used for component, is NOT
being used in the design, a component will be generated and added to design using the name.
enable_renderers – Enable the renderers during the init() of design. The list in config.renderers_to_load() to determine which renderers to enable.
Attributes
Return a Dict of information regarding chip.
Return the metadata Dict object that keeps track of all metadata in the design.
Provides a copy of net_info table which holds all the connections,
Return unique number for each instance.
Returns the QGeometryTables (Use for advanced users only)
Return a Dict of all the renderers registered within QDesign.
Return default_options dictionary, which contain default options used in creating Metal component, and in calling other drawing and key functions.
Return default_renderer_options dictionary, which contain default options used in creating Metal renderer.
Return the Dict object that keeps track of all variables in the design.
Methods
Populate the dict (self.renderer_defaults_by_table) which will hold the data until a component's get_template_options(design) is executed.
QDesign.add_dependency
(parent, child)Add a dependency between one component and another.
Get the text names and corresponding unique ID of each component within this design.
QDesign.connect_pins
(comp1_id, pin1_name, ...)Will generate an unique net_id and placed in a net_info table.
QDesign.copy_multiple_qcomponents
(...[, ...])The lists in the arguments are all used in parallel.
QDesign.copy_qcomponent
(original_qcomponent, ...)Copy a qcomponent in QDesign and add it to QDesign._components using options_overwrite.
Clear all components in the design dictionary.
Clear all pins in the net_Info and update the pins in components.
QDesign.delete_component
(component_name[, force])Deletes component and pins attached to said component.
QDesign.get_chip_layer
([chip_name])Return the chip layer number for the ground plane.
QDesign.get_chip_size
([chip_name])Utility function to get a dictionary containing chip dimensions (size and center).
QDesign.get_chip_z
([chip_name])Utility function to return the z value of a chip.
Get the name of the design from the metadata.
Look at the metadata dict to get list of tables the component uses.
Gets the units of the design.
QDesign.load_design
(path)Load a Metal design from a saved Metal file.
QDesign.parse_options
(params, param_names)Extra utility function that can call parse_value on individual options.
QDesign.parse_value
(value)Main parsing function.
Remakes all components with their current parameters.
QDesign.remove_dependency
(parent, child)Remove a dependency between one component and another.
QDesign.rename_component
(component_id, ...)Rename component.
QDesign.rename_variable
(old_key, new_key)Renames a variable in the variables dictionary.
QDesign.save_design
([path])Save the metal design to a Metal file.
QDesign.set_design_name
(name)Set the name of the design in the metadata.
QDesign.to_python_script
([thin, printout])Generates a python script from current chip :param printout: Whether to print the script :type printout: bool
QDesign.update_component
(component_name[, ...])Update the component and any dependencies it may have.
QDesign.update_metadata
(new_metadata)Update the metadata dictionary of the design with a new metadata dictionary.