err. seem that when filling A-matrix, I should skip i-values that are out of the circuits.