RoutePathfinder

class RoutePathfinder(design, name: str | None = None, options: Dict | None = None, type: str = 'CPW', **kwargs)[source]

Non-meandered CPW class that combines A* pathfinding algorithm with simple 1-, 2-, or S-shaped segment checks and user-specified anchor points. 1. A* heap modified to prioritize paths with shortest length_travelled + Manhattan distance to destination. 2. Checks if connect_simple is valid each time we pop from the heap. If so, use it, otherwise proceed with A*. 3. Tweaks connect_simple to account for end anchor direction in determining which CPW (elbow or S-segment) to use.

RouteAnchors Default Options:
  • anchors: OrderedDict – Intermediate anchors only; doesn’t include endpoints

  • advanced: Dict
    • avoid_collision: ‘false’ – true/false, defines if the route needs to avoid collisions

Default Options:
  • step_size: ‘0.25mm’ – Length of the step for the A* pathfinding algorithm

  • advanced: Dict
    • avoid_collision: ‘true’ – true/false, defines if the route needs to avoid collisions

Initializes all Routes.

Calls the QComponent __init__() to create a new Metal component. Before that, it adds the variables that are needed to support routing.

Parameters:
  • design (QDesign) – The parent design.

  • name (str) – Name of the component. Auto-named if possible.

  • options (dict) – User options that will override the defaults. Defaults to None.

  • type (string) – Supports Route (single layer trace) and CPW (adds the gap around it). Defaults to “CPW”.

Attributes

RoutePathfinder.TOOLTIP

RoutePathfinder.class_name

the full module name with the class name.

RoutePathfinder.component_metadata

Component metadata

RoutePathfinder.default_options

Default options

RoutePathfinder.design

Return a reference to the parent design object.

RoutePathfinder.id

The unique id of component within a design.

RoutePathfinder.length

Sum of all segments length, including the head.

RoutePathfinder.logger

The Qiskit Metal Logger.

RoutePathfinder.name

Name of the component.

RoutePathfinder.options

A dictionary of the component-designer-defined options.

RoutePathfinder.pin_names

The names of the pins.

RoutePathfinder.qgeometry_types

Get a list of the names of the element tables.

RoutePathfinder.pins

Dictionary of pins.

RoutePathfinder.metadata

Metadata allows a designer to store extra information or analysis results.

RoutePathfinder.status

Stores the latest status of the component.

Methods

RoutePathfinder.add_dependency(parent, child)

Add a dependency between one component and another.

RoutePathfinder.add_pin(name, points, width)

Adds a pin from two points which are normal/tangent to the intended plane of the pin.

RoutePathfinder.add_qgeometry(kind, geometry)

Add QGeometry.

RoutePathfinder.assign_direction_to_anchor(...)

Method to assign a direction to a point.

RoutePathfinder.connect_astar_or_simple(...)

Connect start and end via A* algo if connect_simple doesn't work.

RoutePathfinder.connect_components_already_in_design(...)

WARNING: Do NOT use this method during generation of component instance.

RoutePathfinder.connect_simple(start_pt, end_pt)

Try connecting start and end with single or 2-segment/S-shaped CPWs if possible.

RoutePathfinder.del_colinear_points(inarray)

Delete colinear points from the given array.

RoutePathfinder.delete()

Delete the QComponent.

RoutePathfinder.free_manhattan_length_anchors()

Computes the free-flight manhattan distance between start_pt and end_pt passing through all of the given anchor points.

RoutePathfinder.get_pin(name)

Interface for components to get pin data.

RoutePathfinder.get_points()

Assembles the list of points for the route by concatenating: head_pts + intermediate_pts, tail_pts.

RoutePathfinder.get_template_options(design)

Creates template options for the Metal Component class required for the class to function, based on the design template; i.e., be created, made, and rendered.

RoutePathfinder.get_tip()

Access the last element in the QRouteLead.

RoutePathfinder.get_unit_vectors(start, end)

Return the unit and target vector in which the CPW should process as its coordinate sys.

RoutePathfinder.length_excess_corner_rounding(points)

Computes how much length to deduce for compensating the fillet settings.

RoutePathfinder.make()

Generates path from start pin to end pin.

RoutePathfinder.make_elements(pts)

Turns the CPW points into design elements, and add them to the design object.

RoutePathfinder.parse_options([options])

Parse the options, converting string into interpreted values.

RoutePathfinder.parse_value(value)

Parse a string, mappable (dict, Dict), iterable (list, tuple) to account for units conversion, some basic arithmetic, and design variables.

RoutePathfinder.populate_to_track_table_usage()

Use the element_handler to get a list of all the table names used in QGeometry.

RoutePathfinder.qgeometry_bounds()

Fetched the component bound dict_value.

RoutePathfinder.qgeometry_dict(element_type)

Returns a dict of element qgeometry (shapely geometry) of the component as a python dict, where the dict keys are the names of the qgeometry and the corresponding values are the shapely geometries.

RoutePathfinder.qgeometry_list([element_type])

Returns a list of element qgeometry (shapely geometry) of the component as a python list of shapely geometries.

RoutePathfinder.qgeometry_plot([ax, plot_kw])

Draw all the qgeometry of the component (polys and path etc.)

RoutePathfinder.qgeometry_table(element_type)

Returns the entire element table for the component.

RoutePathfinder.rebuild()

Builds the QComponent.

RoutePathfinder.set_lead(name)

Defines the lead_extension by adding a point to the self.head/tail.

RoutePathfinder.set_lead_extension(name)

Defines the jogged lead_extension by adding a series of turns to the self.head/tail.

RoutePathfinder.set_pin(name)

Defines the CPW pins and returns the pin coordinates and normal direction vector.

RoutePathfinder.to_script([thin, ...])

param thin:

If true then any key in the QComponent's options whose value

RoutePathfinder.trim_pts()

Crops the sequence of points to concatenate.

RoutePathfinder.unary_union(geoms)

Returns the union of a sequence of geometries

RoutePathfinder.unobstructed(segment)

Check that no component's bounding box in self.design intersects or overlaps a given segment.

RoutePathfinder.unobstructed_close_up(...)

Checks whether the given component's perimeter intersects or overlaps a given segment.