Tracer
- class circuit_analyzer.all.Tracer
Circuit Tracer: analyze the circuit, tracing its paths and the flow of optical signals.
Build subcircuits between connecting paths. The input is a circuit. Several methods can be called after instantiation:
Use a hierarchy_filter to decide where flattening stops. Use directionality to decide how light can flow between devices when finding paths between A and B.
run: run a frequency sweep and get the tracer results
create_subcircuit: cut a subcircuit from port source to port target
path_data_extraction: extract data from each cell in a path from port source to port target
- Parameters:
- circuit: PCell, required
PCell to analyze.
- inst_information: ( ), optional, *None allowed*
Function that takes in a cell’s layout and returns information.
- view: str and String that contains only ISO/IEC 8859-1 (extended ASCII py3) or pure ASCII (py2) characters, optional
Extract the netlist from the CircuitModel or the Netlist. Option are circuitmodel or netlist.
- directionality: optional
Describes the port combinations where the optical signal can be transmitted through.For instance, for an ideal waveguide without reflections, the input can only transmit light to the output, e.g. {pdk.Waveguide: {‘in’: [‘out’], ‘out’: [‘in’]}
- hierarchy_filter: optional
Filter function that takes in a PCell and returns True if the hierarchy of that cell should be skipped.
- Other Parameters:
- expanded_circuit: locked
Fully expanded circuit by flattening and keeping leaf nodes
Examples
>>> import circuit_analyzer.all as ca >>> import numpy as np >>> # Select only a few wavelength points when using Tracer, as the simulation results are very big >>> wavelengths = np.linspace(1.5, 1.6, 11) >>> tracer = ca.Tracer(circuit=my_circuit) >>> tracer.run(wavelengths=wavelengths).visualize()
- possible_probes()
Returns all possible probes in the circuit.
- run(wavelengths, progress_bar=False)
Run the signal tracer simulation for the given circuit.
The resulting object can be visualized.
Examples
>>> from circuit_analyzer import all as ca >>> circuit = MyCircuit() >>> tracer = ca.Tracer(circuit=circuit) >>> # Note the simulation can be heavy with a lot of ports, >>> # so use a limited number of wavelength points >>> result = tracer.run(wavelengths=np.linspace(1.5, 1.6, 11), progress_bar=True) >>> result.visualize()
- create_subcircuit(source, target, use_source=True, use_target=True, algorithm=None, **kwargs)
Creates a subcircuit of all the components that are part of the paths between source and target.
- Parameters:
- source: tuple
Path to a port of an instance, e.g. ((‘top’, ‘inst1’, ‘subinst1’), “port1”).
- target: tuple
Path to a port of an instance, e.g. ((‘top’, ‘inst2’, ‘subinst2’), “port1”).
- use_source: bool
Whether to take the source or the port of an instance that is connected to source. Default is True.
- use_target: bool
Whether to take the target or the port of an instance that is connected to target. Default is True.
- algorithm: Callable
What algorithm to use to simplify the graph. By default, simplify_graph is used.
- kwargs: dict
Arguments of algorithm.
- Returns
- ——-
- Returns a PCell.
- path_data_extraction(source, target, use_source=True, use_target=True, algorithm=None, save_path=None, **kwargs)
Extract information from a path between source and target.