Skip to content

Manual Validation

Scott Carda edited this page May 22, 2025 · 7 revisions

Preparation

  • open terminal in repo root:
    • pip uninstall qsharp_widgets
    • pip uninstall qsharp
    • python .\build.py --wasm --npm --vscode --pip
    • pip install .\pip\
    • pip install .\widgets\
  • new terminal in repo root:
    • cd vscode
    • npm start
    • This will start a browser instance of VS Code

Workspace integration

To do

Circuit editor

Circuit Visualization

  • Circuit Code Lens
    • Trace circuit: BernsteinVazirani sample
    • Non-trace circuit: BitFlip sample
    • Test Q# projects with circuit files in them: circiut-integartion sample
  • Q# Notebook: circuit notebook

Circuit Editor

  • New circuit file:

image

  • Open existing circuit file:

image

  • Empty existing circuit file
  • Add gate to circuit from the Toolbox
  • Remove gate to circuit
    • Drag gate off of circuit
    • Context menu -> Delete
  • Add controls to gate
    • Context menu -> Add Control
  • Remove controls from gate
    • Drag control off of circuit
    • Context menu for gate -> Remove Control
    • Context menu for control -> Delete
  • Adding Qubits:
    • Repeated add qubits by dragging the same gate down onto ghost line
  • Moving Qubits:
    • Swap qubit lines with gates
    • Move qubit line with gates
    • Non-trailing empty qubit line allowed
  • Delete Qubits:
    • Move empty qubit line to last line
    • Swap empty qubit line to last line
    • Remove last gate in last qubit line
      • With multiple empty qubit lines behind it
    • Drag qubit line outside of circuit
  • Moving Gates:
    • Can't move onto existing gate
    • Can't move onto existing control
      • But can swap with own control
    • Can't move onto existing control lines of other gates (line connecting gate to controls)
      • But can do this for own gate's control lines

CE - drag and drop 5

  • Can move gate into existing column
  • Can make new column inside circuit
    • And at the end of the circuit
    • And at the beginning
  • Empty columns are removed
  • Gates with controls move with their controls
    • When moving the gate
    • When moving the control
  • Gates with Arguments:
    • Argument is prompted upon gate creation
    • Cancel will cancel gate creation
    • "OK" button disabled until valid input
      • Empty input
      • Non-arithmetic input
      • When input goes from valid to invalid
    • Edit argument by click on arg
    • Edit argument by context menu
    • Cancel button will cancel edit of argument
    • Pi button works
    • Entering "pi" works
  • Measurement Gates:
    • Multiple measure lines for multiple measures on same qubit
    • Measurement lines move with gate
    • When moving, measurement lines from former qubit update

CE - measurement gates

Circuit File Integration with Q#

  • Can Run Q# project with Circuit File used as operation: circuit_integration sample
  • Circuit signature with empty circuit
    • operation Circuit() : Unit is Adj + Ctl
  • Circuit signature with 1 qubit
    • operation Circuit(qs : Qubit[]) : Unit is Adj + Ctl
    • Description: "Expects a qubit register of at least 1 qubits."
  • Circuit signature with many qubits
    • operation Circuit(qs : Qubit[]) : Unit is Adj + Ctl
    • Description: "Expects a qubit register of at least 3 qubits."
  • Circuit signature with no measurements
    • Returns Unit and is Adj + Ctl
  • Circuit signature with one measurement
    • Returns Result and is not Adj or Ctl
  • Circuit signature with many measurements
    • Returns Result[] and is not Adj or Ctl
  • Pass too few qubits to circuit
    • Run the Q# project to see a runtime error: "Error: program failed: Invalid number of qubits. Operation Foo expects a qubit register of at least 3 qubits."
  • Pass extra qubits to circuit
    • Run the Q# project to see no errors
  • Circuit signature updates in real time from circuit edits

Copilot

To do

Code Lens

To do

QASM in the UI

To do

Jupyter Notebooks & widgets (in VS Code, browser, and Google Collab)

To do

VS Code panels (RE & histograms)

To do

Debugging

To do

aka.ms/qdk.dev

To do

Libraries from GitHub

To do

Test Explorer

To do

Clone this wiki locally