Summary
Circuit.ac() unconditionally raises ValueError when solver.is_complex=True:
if self.solver.is_complex:
raise ValueError(
"Circuit.ac() currently supports real-valued circuits. "
"Use the low-level AC API for complex circuits."
)
This blocks AC small-signal analysis for photonic (complex-valued) circuits, which is a common use case — e.g. computing RF modulation bandwidth of an electro-optic modulator, or small-signal response of a ring resonator.
Requested
Either:
- Expose a high-level
circuit.ac() path for complex circuits using the existing setup_ac_sweep infrastructure, or
- Document the low-level
setup_ac_sweep API with a photonic example so callers can work around the guard
The error message already hints at setup_ac_sweep but there's no public example of using it with is_complex=True.
Context
We're integrating circulax into GDSFactory+ (gdsfactoryplus) as a simulation engine. We've wired up DC, HB, and Transient — AC is the only one we're having to stub out for photonic circuits due to this guard. Happy to contribute a fix if pointed in the right direction.
Summary
Circuit.ac()unconditionally raisesValueErrorwhensolver.is_complex=True:This blocks AC small-signal analysis for photonic (complex-valued) circuits, which is a common use case — e.g. computing RF modulation bandwidth of an electro-optic modulator, or small-signal response of a ring resonator.
Requested
Either:
circuit.ac()path for complex circuits using the existingsetup_ac_sweepinfrastructure, orsetup_ac_sweepAPI with a photonic example so callers can work around the guardThe error message already hints at
setup_ac_sweepbut there's no public example of using it withis_complex=True.Context
We're integrating circulax into GDSFactory+ (gdsfactoryplus) as a simulation engine. We've wired up DC, HB, and Transient — AC is the only one we're having to stub out for photonic circuits due to this guard. Happy to contribute a fix if pointed in the right direction.