Working with big circuits
Qlasskit is capable of producing large circuit without any issue. The only thing that you have to do, is to use the fastOptimizer
, since running CSE is too slow on large expressions lists.
In the next example we are going to create a quantum circuit with 64 Qint8
in input, and one Qint8
in output, resulting on a circuit of ~21984 qubits and ~1044 gates in around 5 seconds.
from qlasskit import Qint8, Qlist, boolopt, qlassfa
@qlassfa(bool_optimizer=boolopt.fastOptimizer)
def test(a_list: Qlist[Qint8, 64]) -> Qint8:
h_val = Qint8(0)
for c in a_list:
h_val = h_val + c
return h_val
print(test.circuit())
QCircuit<test>(21831 gates, 1036 qubits)