PhilippAumann / circuitq

Toolbox for the simulation and analysis of superconducting circuits.
MIT License
39 stars 9 forks source link

Problem with shunt capacitance to ground #3

Open alelandra opened 3 years ago

alelandra commented 3 years ago

While drawing a flux tunable two island transmon I was not able to implement correctly the shunt capacitance to ground of left and right island.

graph = nx.MultiGraph()
graph.add_edge(1, 2, element='C')
graph.add_edge(1, 2, element='J')
graph.add_edge(1, 2, element='J')
# shunt capacitances to ground
graph.add_edge(0, 1, element='C')
graph.add_edge(2, 3, element='C')

circuit = cq.CircuitQ(graph, ground_nodes= [0,3])
circuit.h

where the error is Exception: Specified ground node 0 is not an active node.

It seems this error is present in also more complex structures, whenever a ground node is not terminated at some qubit node. One could terminate all the ground nodes of a complex circuit to the same qubit ground node for example, although the graph get a bit confusing and makes the ground_nodes= parameter useless, and I am not sure if it is interpreted correctly since both C will be called C01

PhilippAumann commented 3 years ago

Hi Alessandro, thank you for your issue and food for thought :) For the quantization of a circuit, circuitq follows the procedure outlined by Vool and Devoret. They demand that any ground node, should be an active node, which is a node to which at least one inductive element is connected. If I am not mistaken, the reason for this is the construction of the spanning-tree which is used as a gauge to define the flux variables of the inductive branches. That's the reason you get the exception, which is a design choice. Furthermore, in your above example, setting the 0 and 3 node as ground nodes merges those nodes to one node with the 0 potential level. This merged node is solely connected to capacitors, which means it will only appear in the kinetic, but not in the potential part of the Hamiltonian. Those completely capacitive nodes are not supported in circuitq. If there are good reasons for it, we could consider adding such nodes - however merging serial capacitors (which is automatically done by circuitq) resolves this problem most of the time. Do you really need the shunt capacitances to ground? I understand that they are there coming from a manufacturing point of view, but if you only want to study a tunable transmon, using

graph = nx.MultiGraph()
graph.add_edge(1, 2, element='C')
graph.add_edge(1, 2, element='J')
graph.add_edge(1, 2, element='J')

will be enough to otbain the relevant physics. (circuitq will automatically ground one of the two nodes - which you can also specify of course). In general - if you compare circuitq with a toolbox like KQCircuits, which is an application that is really close to the real physical superconducting device, circuitq is more meant to study the fundamental physics in the lumped element regime without the implementation oriented focus like KQCircuits. Therefore it's always a good idea to simplify the circuit to the most fundamental part, which really does the physics - if that makes sense.

alelandra commented 3 years ago

Hi Philipp, thanks for the explanation! Somehow that is what I was expecting. circuitq is very good and easy to use when you have a network which uses only effective capacitive/inductive networks, meaning that a theorist simplified the model for me to an effective model. However people like me (I am among KQC authors :) ), who draws actual circuits, encounter many parasitic capacitances which are usually modeled as purely capacitive nodes to ground and they play a role in the kinetic part of the Hamiltonian (for example the qubit charging energy, which is not always trivial due to these extra ground capacitances). These nodes play an incredible role in the behavior of the chip performance, since the shunt capacitance often exceed the direct capacitance. I agree this is mainly an engineering concept, but it would be cool if at some point the tool could handle them. Just to mention another example, if one has two qubits coupled by a superconducting island bus, it would be very necessary to model the shunt capacitance of the island. Hope I clarified a bit.

PhilippAumann commented 3 years ago

Adding such purely capacitive nodes will certainly broaden the scope of circuitq to a more implementation oriented way of modelling circuits. This will certainly be helpful and we should treat your issue as a feature request - as it's not a problem with the code itself but simply a residue of the design choices made when developing the toolbox. However, this would be a major revision, as the current numerical implementation relies on the fact, that any charge node has a corresponding flux node appearing in the Hamiltonian. For that reason, I am not sure how soon such a feature will be implemented - however we are of course always open for pull requests :)