Gah, too much formulating...
Cards in deck = D
Quantum Pillars in deck = Q
Percent of Qpillars in deck = Q/D = Q%
Average number of pillars in starting hand = 7*Q% = Qs
Average number of turns you can survive without playing most expensive cost card= T
Number of pillars drawn and played during a game after first turn = (Q - Qs)(Q%-(Qs/D-7)T = Qp
Quanta generated by pillars in starting hand = 3Qs*(T+1) (Remove the +1 for non-upgraded pillars)
Quanta generated by pillars drawn = 3Qp*(Q%*T) (Use T-1 for non upgraded pillars)
Total Quanta Generated = (3Qs*(T+1))+3Qp*(Q%*T) = QT
Average Quanta of each element generated = QT/12
Cost of the most expensive card you have to play nearly every game in order to win.
Assuming miracle is your most expensive card, and you're not using supernovas or mark of life, then you need 12 light quanta before you die. Really, you have many other cards that will save you, but those are less expensive, so you are only concerned with producing enough for the most expensive one before you die.
I have 10 pillars in a 40 card deck
D=40, Q=10, Q%=.25,Qs=1.75,Qp =T*1.62525
QT = 3*1.75*(T+1)+3*T*1.62525*.25*T
(5.25T+5.25+1.2189375 *T^2)/12=12
5.25t+5.25+1.2189375*T^2 = 12*12=144
5.25+1.2189375*t = 138.75/t
t = 138.75/1.2189375t - 5.25/1.2189375
t = 138.75/1.2189375t - 4.30703
t = 8.7307060839
So with 10 pillars and a need to cast miracle every game to win, you would have to survive 9 turns before casting miracle. Of course, lets assume that 6 of your cards are supernovas.
Each supernova you draw effectively reduces the cost of the miracle from quantum generated by 2. Your average chance to draw a supernova in those turns is 7+T)/33-T. This means that in just 3 turns you have a 30% chance to have 2 supernovas, so we can safely assume that 2 supernovas is likely in every game. Now we just reduce the cost of our target card by 4.
With a cost of 8 we come to 5.25t+5.25+1.2189375*t^2=12*8=96
This resuts in t = 6.7396123218, so you need to survive for 7 turns, but in 6 turns, you actually have a %50 or better chance of drawing a 3rd supernova, so again the cost is reduced.
This gives us a result of t = 5.5535229926.
This means that with 10 quantum towers and 6 supernovas in a 40 card deck, you should have enough quanta to drop anything you need by the 6th turn.
Now go out there an make your algebra teachers proud by building rainbow decks.
Jallen