Add failing example circuit of an LC shunt#76
Draft
nikosavola wants to merge 2 commits intoflaport:mainfrom
Draft
Add failing example circuit of an LC shunt#76nikosavola wants to merge 2 commits intoflaport:mainfrom
nikosavola wants to merge 2 commits intoflaport:mainfrom
Conversation
Collaborator
|
@flaport can you take a look at this ? this prevents hierarchical circuits |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hi @flaport,
I was trying to implement a one-port
lc_shunt_componentbut I seem to get errors with Jax that I don't fully understand. Something to do with varying array size I think.You may run the test here with:
uv run pytest -k "test_lc_shunt_component"I tried without @jax.jit in the core RF models but then this fails at the point where the circuit is flattened (
_flat_circuit), either inanalyze_insts_fnoranalyze_fn.Do you know what might be the problem?
Traceback
src/tests/test_rf_models.py:166: in test_lc_shunt_component s = type(self).lc_shunt_component( src/tests/test_rf_models.py:127: in lc_shunt_component circuit, _ = sax.circuit( src/sax/circuits.py:165: in circuit current_models[model_name] = circuit = _flat_circuit( src/sax/circuits.py:345: in _flat_circuit analyzed = analyze_fn(dummy_instances, connections, ports) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ src/sax/backends/klu.py:130: in analyze_circuit_klu CSi = jnp.broadcast_to(Ci[None, :], mask.shape)[mask] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ .venv/lib/python3.13/site-packages/jax/_src/numpy/array_methods.py:1141: in op return getattr(self.aval, f"_{name}")(self, *args) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ .venv/lib/python3.13/site-packages/jax/_src/numpy/array_methods.py:678: in _getitem return indexing.rewriting_take(self, item) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ .venv/lib/python3.13/site-packages/jax/_src/numpy/indexing.py:655: in rewriting_take treedef, static_idx, dynamic_idx = split_index_for_jit(idx, arr.shape) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ .venv/lib/python3.13/site-packages/jax/_src/numpy/indexing.py:755: in split_index_for_jit idx = _expand_bool_indices(idx, shape) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ .venv/lib/python3.13/site-packages/jax/_src/numpy/indexing.py:1092: in _expand_bool_indices raise errors.NonConcreteBooleanIndexError(abstract_i) E jax.errors.NonConcreteBooleanIndexError: Array boolean indices must be concrete; got bool[27,10] E E See https://docs.jax.dev/en/latest/errors.html#jax.errors.NonConcreteBooleanIndexError E -------------------- E For simplicity, JAX has removed its internal frames from the traceback of the following exception. Set JAX_TRACEBACK_FILTERING =off to include these.