# How to represent two gates addition on Qiskit composer. we can do tensor product and multiplication but how to do Addition

How to represent two gates addition on Qiskit composer we can do it in python code by using qiskit library but I would like to visually see how addition of two operators look like in composer.

I am currently working on VQLS Algorithm and we have to decompose given matrix into linear combination of unitary matrices. I want to see that in Qiskit composer.

Thanks

• Would you consider writing it in code and using decomposition there before printing the circuit? Mar 24 at 15:09
• Can you give some sample code for addition operator. Mar 26 at 1:52
• Not sure I understand, but I assume you mean how to combine two operators into one? You can use compose for that: qiskit.org/documentation/stubs/… What is more, you can decompose any operator (as long as it's an actual quantum operator) into a series of basic operators using either decompose qiskit.org/documentation/stubs/… or transpiler qiskit.org/documentation/apidoc/transpiler.html Mar 30 at 13:47
• I mean when I decompose a non unitary matrix into series pauli base matrices like ( A = aX + bY + cZ ) where X,Y,Z are pauli basis and I want to visually show my matrices decomposition on composer and if I keep my operators side by side it will do multiplication..My question is How to show it on composer? should i create a custom gate or How ? and one more question is how to show my coefficient values along with my operator ? any QISKIT Composer snip will help.. Thanks in Advance Apr 3 at 13:48

Assuming you mean IBM Quantum composer, it allows OpenQASM 2.0 as input. You could synthesises your circuit and them exported as OpenQASM 2.0:

from qiskit import QuantumCircuit, transpile
matrix = [[0, 0, 0, 1],
[0, 0, 1, 0],
[1, 0, 0, 0],
[0, 1, 0, 0]]

circuit = QuantumCircuit(2)
circuit.unitary(matrix, [0, 1])
circuit.decompose().qasm(filename='my_circuit.qasm')

Then, take my_circuit.qasm and import it in IBM Quantum Composer: