Skip to content
This repository has been archived by the owner on Jan 12, 2024. It is now read-only.

First step to implementing classically-controlled gates #290

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

theRoughCode
Copy link
Contributor

@theRoughCode theRoughCode commented Aug 20, 2020

This PR is meant to serve as guidance to how to implement classically-controlled operations within the execution path visualization feature described in #158.

Here are some notes:

  1. The JS visualizer already handles classically-controlled gates and their interactivity.
  2. This PR depends on this PR to be merged to be able to distinguish classically-controlled operations.

In this PR, we:

  1. Use the IsConditional flag in the RuntimeMetadata class to check if the given operation is a classically-controlled operation.
  2. Override the logic for ApplyIfElseR with a custom TracerApplyIfElse.

If this logic makes sense, the next steps are to:

  • Override conditional logic for all other variants of ApplyIfElse
  • Perform an IRewriteStep to convert if/else statements to ApplyIfElse
  • Reduce ApplyIfOne and ApplyIfZero to ApplyIfElse.

@theRoughCode theRoughCode marked this pull request as draft August 20, 2020 18:30
@microsoft-github-updates microsoft-github-updates bot changed the base branch from master to main September 9, 2020 07:52
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant