Open decod81 opened 2 years ago
Hi @decod81,
Thanks for using SQcircuit and sharing your issue with us.
The error that you encountered is an old piece of code (I should have removed it). Basically, SQcircuit should be able to solve your problem. I will take a look at the circuit and I will get back to you. Probably there is a bug that I should fix.
Hi @decod81
Let me clarify several points regarding your issue.
cir.set_trunc_nums([15, 9, 9, 1])
. In future versions, we omit these modes internally and we just give the users modes that are part of the dynamic.Thank you very much for the quick fix and clarifications.
Upon my quick testing it seems to work now most of the time. It did fail once though in the middle of a bunch of runs with the same message and then worked again with the next runs (working and failed runs were with identical parameters). I guess there is some random factor that causes fail every now and then, but as long as it doesn't become too frequent in some interesting parameter range, I think it's good.
I guess I might run into problems with some of my circuits due to too large Hilbert space for practical simulations, but I suppose that was to be expected. Good to know you're working on it.
Hi @decod81, Thanks again for your great feedback. I noticed the problem. It is an issue with Gram–Schmidt process accuracy. I will fix it in the next patch (0.0.15).
Hi. I was hoping to quickly try out different coupling circuits between two transmons and generate numerical Hamiltonians for the system in order to simulate CZ gate fidelities in time domain, but seems SQcircuit is unable to solve most of my circuits. It just gives ValueError: This solver cannot solve your circuit. I give the simplest example of my code here so one can replicate the problem.
My brief investigation suggests some accuracy check fails in circuit.py. If I remove the check, the code executes, but it sees 4 modes instead of 3 as there should be (easy to verify for example in qucat). I guess SQcircuit needs the number of nodes to correspond to the number of modes, but for arbitrary schematics this is often not the case.
I tried using qucat to generate Hamiltonians as well, but qucat only generates near diagonal H and eliminates the coupling terms I need for my simulations so I was hoping SQcircuit could solve my problem. A quick numerical test I did appeared to suggest SQcircuits might be usable the way I hoped for simple capacitively coupled transmons, but maybe not for more complicated circuits. Perhaps also worth mentioning is that to get correct eigenfrequencies even for capacitively coupled qubits, I had to use relatively high truncation number (maybe 10) which resulted in rather large numerical H compared to what would otherwise suffice if one derives it by hand (3) and while perhaps not an issue as such, it would slow down the numerical simulations quite a bit.
I'm not sure if these are bugs or features, but I just felt it might be worthwhile to bring into your attention what I was hoping for from SQcircuit and how I at least so far failed to reach it. Comments and suggestions are appreciated.