arnaudon / netSALT

Simulation of lasing networks with quantum graphs and SALT theory.
https://arnaudon.github.io/netSALT/
GNU General Public License v3.0
5 stars 1 forks source link

Node ordering issue #29

Closed razimantv closed 5 months ago

razimantv commented 5 months ago

https://github.com/arnaudon/netSALT/blob/3c48f14ddcaafcf8ff62a63d221df5c8334bf944/netsalt/tasks/passive.py#L69

This line assumes that node u is the uth element of quantum_graph.nodes. This is not the case since nx.nodes is not a sorted container.

razimantv commented 5 months ago

I thought of solving it by simply using sorted(quantum_graph.nodes) but I think the node numbers don't even need to be consecutive. We might have to use some internal numbering and map all nodes and edges to that one.

arnaudon commented 5 months ago

Here is the fix: https://github.com/arnaudon/netSALT/pull/30