Real, standard OpenQASM 2.0 circuits offered as Composer presets —
textbook examples (Bell pair, GHZ, W-state) and dense_evolution's own
gate library exercised end to end, not synthetic placeholder text.
Real, standard OpenQASM 2.0 circuits offered as Composer presets --
textbook examples (Bell pair, GHZ, W-state) and dense_evolution's own
real circuit generators (QFT, random circuit), not synthetic results.
The Composer runs every one of these through the real engine just like
any custom circuit typed in by hand.
Converts a dense_evolution gate-tuple circuit (the format
de.qft/de.ghz_state/de.random_circuit/... all return) into real
OpenQASM 2.0 text, so any of dense_evolution's own circuit generators
can be offered as a Composer preset without hand-transcribing gates.
Source code in tools/dashboard_core/qasm_library.py
defgate_tuples_to_qasm(ops,n_qubits:int,measure:bool=True)->str:"""Converts a dense_evolution gate-tuple circuit (the format de.qft/de.ghz_state/de.random_circuit/... all return) into real OpenQASM 2.0 text, so any of dense_evolution's own circuit generators can be offered as a Composer preset without hand-transcribing gates."""lines=['OPENQASM 2.0;','include "qelib1.inc";',f'qreg q[{n_qubits}];']ifmeasure:lines.append(f'creg c[{n_qubits}];')foropinops:name=op[0]ifnamein_ONE_QUBIT_STATIC:lines.append(f'{name} q[{op[1]}];')elifnamein_ONE_QUBIT_PARAM:lines.append(f'{name}({op[2]}) q[{op[1]}];')elifnamein_TWO_QUBIT_STATIC:lines.append(f'{name} q[{op[1]}],q[{op[2]}];')elifnamein_TWO_QUBIT_PARAM:lines.append(f'{name}({op[3]}) q[{op[1]}],q[{op[2]}];')elifnamein_THREE_QUBIT_STATIC:lines.append(f'{name} q[{op[1]}],q[{op[2]}],q[{op[3]}];')else:raiseValueError(f"gate_tuples_to_qasm: unrecognized gate {name!r}")ifmeasure:lines.append('measure q -> c;')return'\n'.join(lines)+'\n'