You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would like to use instatiation on a parametrized circuit which includes controlled operations:
circuit = Circuit(4)
V1 = VariableUnitaryGate(3)
# control on 0
circuit.append_gate(ControlledGate(V1, num_controls=1), [0,1,2,3])
circuit.instantiate(
unitary,
method='qfactor',
diff_tol_a=1e-12, # Stopping criteria for distance change
diff_tol_r=1e-10, # Relative criteria for distance change
dist_tol=1e-12, # Stopping criteria for distance
max_iters=100000, # Maximum number of iterations
min_iters=1000, # Minimum number of iterations
slowdown_factor=0, # Larger numbers slowdown optimization
# to avoid local minima
)
I currently get the following error:
Cannot instantiate circuit with qfactor because the following gates are not locally optimizable: Controlled(VariableUnitaryGate(3, (2, 2, 2))).
When using minimization the code produces a similar error.
From my understanding, the problem is that ControlledGate is not a LocallyOptimizableUnitary.
Is there a way to circumnavigate this issue, is it a missing feature or is it simply impossible to use controlled parametrized gates with the instantiation method?
The text was updated successfully, but these errors were encountered:
It is hard to say if it is possible or impossible, but it is not currently implemented. If the instantiation is more important than using Qfactor, you can swap the VariableUnitaryGate for a PauliGate, which should work with minimization.
I would like to use instatiation on a parametrized circuit which includes controlled operations:
I currently get the following error:
When using
minimization
the code produces a similar error.From my understanding, the problem is that
ControlledGate
is not aLocallyOptimizableUnitary
.Is there a way to circumnavigate this issue, is it a missing feature or is it simply impossible to use controlled parametrized gates with the instantiation method?
The text was updated successfully, but these errors were encountered: