| Signature | Description |
Circuit(title: str) | Flat circuit. str(circuit) → netlist. |
Subcircuit(name: str, ports: list[str] = None, **params) | Reusable, nestable design block. Same element/directive methods as Circuit. |
.gnd | Ground node ("0"). |
.node(name) -> str | Node name passthrough. |
.element(name) -> str / circuit[name] | Retrieve an element's netlist line. |
.set_source_value(name, value) | Update a V/I source value after construction. |
.simulator(simulator: str = None) -> CircuitSimulator | Circuit only. Auto-selects backend unless overridden. |
.subcircuit(subckt: Subcircuit) | Add a subcircuit definition. |
| Method | SPICE | Signature |
R | R | (name, positive, negative, value, raw_spice=None) |
C | C | (name, positive, negative, value) |
L | L | (name, positive, negative, value) |
K | K | (name, inductor1, inductor2, coupling) |
V | V | (name, positive, negative, value, ac=None, ac_phase=None) |
I | I | (name, positive, negative, value, ac=None, ac_phase=None) |
BV | B | (name, positive, negative, expression) — behavioral voltage |
BI | B | (name, positive, negative, expression) — behavioral current |
E | E | (name, positive, negative, control_positive, control_negative, voltage_gain) — VCVS |
G | G | (name, positive, negative, control_positive, control_negative, transconductance) — VCCS |
F | F | (name, positive, negative, vsense, current_gain) — CCCS |
H | H | (name, positive, negative, vsense, transresistance) — CCVS |
D | D | (name, anode, cathode, model) |
Q / BJT | Q | (name, collector, base, emitter, model) |
M / MOSFET | M | (name, drain, gate, source, bulk, model, **params) — params e.g. L=0.5, W=5 |
J | J | (name, drain, gate, source, model) — JFET |
Z | Z | (name, drain, gate, source, model) — MESFET |
S | S | (name, positive, negative, control_positive, control_negative, model) — V-controlled switch |
W | W | (name, positive, negative, vcontrol, model) — I-controlled switch |
T | T | (name, input_positive, input_negative, output_positive, output_negative, Z0, TD) |
X | X | (name, subcircuit_name, *nodes) — positional |
A | A | (name, connections: list[str], model) — XSPICE code model |
| Method | Signature |
SinusoidalVoltageSource / SinusoidalCurrentSource |
(name, positive, negative, dc_offset=0.0, offset=0.0, amplitude=1.0, frequency=1000.0) |
PulseVoltageSource / PulseCurrentSource |
(name, positive, negative, initial_value=0.0, pulsed_value=1.0, pulse_width=50e-9, period=100e-9, rise_time=1e-9, fall_time=1e-9) |
PieceWiseLinearVoltageSource |
(name, positive, negative, values: list[tuple[float, float]]) — (time, value) pairs |
| Member | Description |
CircuitSimulator.available_backends() -> list[str] | Static. Backends installed locally. |
.options(**kwargs) | Solver options (RELTOL, ABSTOL, VNTOL, GMIN, …). |
.initial_condition(**node_values) | .ic |
.node_set(**node_values) | .nodeset |
.save(*signals) | Explicit save list, e.g. "V(out)", "I(Vdd)". |
.save_currents = bool | Save all branch currents. |
.measure(*parts) | .meas, e.g. ("TRAN", "v_peak", "MAX", "V(out)"). |
.temperature = float / .nominal_temperature = float | .temp / tnom. |
.step(param, start, stop, step) | Linear .step. |
.step_sweep(param, start, stop, step, sweep_type) | "lin" | "oct" | "dec". |
.check_backend(name) -> list[str] | Compatibility issues. |
| Method | Returns |
operating_point() | OperatingPoint |
dc(**{source: slice(start, stop, step)}) | DcAnalysis |
ac(variation="dec", number_of_points=10, start_frequency=1.0, stop_frequency=1e9) | AcAnalysis |
transient(step_time, end_time, start_time=None, max_time=None, use_initial_condition=False) | TransientAnalysis |
noise(output_node, ref_node, src, variation="dec", points=10, start_frequency=1e3, stop_frequency=1e8, points_per_summary=None) | NoiseAnalysis |
transfer_function(outvar, insrc) / tf(...) | TransferFunctionAnalysis |
dc_sensitivity(output_variable) | SensitivityAnalysis |
ac_sensitivity(output_variable, variation="dec", number_of_points=10, start_frequency=100.0, stop_frequency=1e5) | SensitivityAnalysis |
polezero(node1, node2, node3, node4, tf_type, pz_type) | PoleZeroAnalysis |
distortion(variation="dec", points=10, start_frequency=100.0, stop_frequency=1e8, f2overf1=None) | DistortionAnalysis |
pss(fundamental_frequency, stabilization_time, observe_node, points_per_period=128, harmonics=10) | PssAnalysis |
s_param(variation="dec", number_of_points=10, start_frequency=1e6, stop_frequency=1e10) | SParamAnalysis |
harmonic_balance(fundamental_frequencies: list, num_harmonics=None) | HarmonicBalanceAnalysis |
stability(probe, variation="dec", number_of_points=10, start_frequency=1.0, stop_frequency=1e10) | StabilityAnalysis |
transient_noise(step_time, end_time) | TransientNoiseAnalysis |
network_params(output_current, input_source, z_in=50.0, z_out=50.0, variation="dec", points=100, start_freq=1e3, stop_freq=1e9) | SParamAnalysis |
| Method | Returns |
spectre_sweep(param, start, stop, step, inner_analysis, inner_type="ac") | RawData |
spectre_montecarlo(num_iterations, inner_analysis, inner_type="ac", seed=None) | RawData |
spectre_pac(pss_fundamental, pss_stabilization, pss_harmonics=10, variation="dec", points=100, start_freq=1.0, stop_freq=1e9, sweep_type="relative") | AcAnalysis |
spectre_pnoise(pss_fundamental, pss_stabilization, pss_harmonics=10, output_node, ref_node, variation="dec", points=100, start_freq=1.0, stop_freq=1e9) | NoiseAnalysis |
spectre_pxf(pss_fundamental, pss_stabilization, pss_harmonics=10, output_node, source, variation="dec", points=100, start_freq=1.0, stop_freq=1e9) | AcAnalysis |
spectre_pstb(pss_fundamental, pss_stabilization, pss_harmonics=10, probe, variation="dec", points=100, start_freq=1.0, stop_freq=1e9) | StabilityAnalysis |
| Quantity | Constants |
| Voltage | u_V, u_mV, u_uV (u_µV) |
| Current | u_A, u_mA, u_uA, u_nA (u_µA) |
| Resistance | u_Ohm, u_kOhm, u_MOhm (u_Ω, u_kΩ, u_MΩ) |
| Capacitance | u_F, u_mF, u_uF, u_nF, u_pF, u_fF (u_µF) |
| Inductance | u_H, u_mH, u_uH, u_nH (u_µH) |
| Frequency | u_Hz, u_kHz, u_MHz, u_GHz |
| Time | u_s, u_ms, u_us, u_ns, u_ps (u_µs) |
| Power | u_W, u_mW, u_uW (u_µW) |
| Temperature | u_Degree |