I'm trying to use the
.compose() method to join two parametrized circuits, specifically
TwoLocal instances from the
While I would expect that
.num_parameters_settable() would be the sum of the parameters in each circuit, the final circuit will have only as many settable parameters as only one of them.
Thank you very much for your help!
My code is:
from qiskit.circuit.library import TwoLocal import numpy as np rot = TwoLocal( int(np.sum(num_qubits)), "ry", , reps=1, skip_final_rotation_layer=True, parameter_prefix="p", ) var = TwoLocal( int(np.sum(num_qubits)), "ry", "cx", entanglement="linear", reps=1, skip_final_rotation_layer=True, ) rot.num_parameters_settable() >> 2 rot.compose(var, inplace=True) rot.num_parameters_settable() >> 2