Fix UnitaryGate.qasm()
with unused qubits
#8234
Merged
UnitaryGate.qasm()
with unused qubits
#8234