To add on top of @Davit answer. Suppose you want to do certain operations, in this case is Controlled-S or Controlled-T, and it is not directly implement on the circuit composer. But you want to use the circuit composer to have better visualization of the circuit. What you can do is to create these gate directly in Qiskit and decompose to OpenQASM
code, which then you can import it directly to the circuit composer.
Here is an example:
Suppose we want to create Controlled-S gate, then we can just use the Quantum Lab to create this gate as follow:
from qiskit import QuantumRegister, ClassicalRegister, QuantumCircuit
from numpy import pi
qreg_q = QuantumRegister(1, 'q')
creg_c = ClassicalRegister(1, 'c' )
circuit = QuantumCircuit(qreg_q)
circuit.s(qreg_q[0])
print(circuit)
┌───┐
q_0: ┤ S ├
└───┘
This is just to create the S gate. We then can create the Controlled-S gate by
xs_gate = circuit.to_gate()
cxs_gate = xs_gate.control()
qreg_q = QuantumRegister(2, 'q')
creg_c = ClassicalRegister(2, 'c')
circuit = QuantumCircuit(qreg_q)
circuit.append(cxs_gate, [0,1])
print(circuit)
q_0: ──────■──────
┌─────┴─────┐
q_1: ┤ circuit23 ├
└───────────┘
Now we can decompose this circuit into elementary gates as:
qasm_circuit = circuit.decompose()
print( qasm_circuit )
┌────────┐
q_0: ┤ P(π/4) ├──■───────────────────■──────────────
├────────┤┌─┴─┐┌─────────────┐┌─┴─┐┌──────────┐
q_1: ┤ P(π/4) ├┤ X ├┤ U(0,0,-π/4) ├┤ X ├┤ U(0,0,0) ├
└────────┘└───┘└─────────────┘└───┘└──────────┘
You can see that the above circuit is similar to what Davit suggested. Now you can convert this circuit into OpenQASM
using:
print(circuit.decompose().qasm())
which will output:
OPENQASM 2.0;
include "qelib1.inc";
qreg q[2];
p(pi/4) q[0];
p(pi/4) q[1];
cx q[0],q[1];
u(0,0,-pi/4) q[1];
cx q[0],q[1];
u(0,0,0) q[1];
Now you can take this and import it to your circuit composer under the OpenQASM
Code editor