Bloq Logo

Welcome to the Quantum Circuit Builder!

About This App

This is a visual quantum circuit builder. You can drag and drop quantum gates (operators) onto a grid to construct quantum circuits. Some gates can be composed of other elementary gates. Here, CG is composed of four Hadamard gates in a certain configuration.

Your Task

Task 1: XRay View for Custom Gate

CG is a custom gate composed of four Hadamard gates as described in the components field in the operator definition.

Implement an XRay View for the custom gate that expands it to show its components in a grid layout.

The expanded view should be toggled by clicking on the Eye () icon that appears when you hover over the custom gate.

XRay View Sample

Task 2: Support Gates of Varying Width

Add support for gates of varying width. When a custom gate is expanded, it can appear to span multiple columns. Ensure that the following conditions are met:

  • Any gates in the same row (qubit) should not overlap.overlap
  • A gate spanning a width more than the default width of a column (here, CG in expanded view) should continue to have at most one gate in the same column across all qubits (hence effectively constituting only one column).overlap
There are no constraints on how the solution should be implemented - only ensure that you can defend your choices.

Operators

H
CG
Circuit
Q0
Q1
Q2