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

Conversation

@IrinaYatsenko
Copy link
Contributor

@IrinaYatsenko IrinaYatsenko commented Nov 10, 2020

I misunderstood specifications of PrepareArbitraryState. The API guarantees that if the qubits, the state is being injected for, are unentangled and each is in state |0>, then they will be transformed into the requested state, otherwise, the API will perform a valid albeit undefined unitary operator but it shouldn't throw.

Considered options:

  1. Ignore the failed prereq and apply the same logic as we have now for state update -> Cannot do this, because it might end up not being a unitary operation in the partial state injection case (*)
  2. Do nothing (apply identity transform to the state) -> We currently rely on Q# to do adjoint operator, which means the base and adjoint must match but they wouldn't in this case (**)
  3. Bail out and let Q# know that it has to do the quantum state preparation -> implemented in this change

(*) Given how state setting is implemented now. Conceivably, there might be other algorithms that are both efficient and guarantee unitariness even if prereqs aren't satisfied? Also, could we still do this for total state injection?
(**) I don't believe it's easy/efficient to implement emulation of adjoint state prep, but even if it were, the unitary we apply cannot depend on the state of qubits because the base/adjoint might be applied in different states.

Note: The bug was found in course of reviewing microsoft/QuantumLibraries#370

swernli and others added 30 commits June 17, 2020 18:26
* Refactor QSharp.Core into Foundation + Core

* Trying to fix sln

* Splitting Utils.qs

* Moving ClassicalControl.qs

* Reverting Intrinsic.I change
Merging master and fixing up solution file.
Merge remote-tracking branch 'origin/master' into swernli/decomp-merge-master
Merge remote-tracking branch 'origin/master' into feature/decomp
Merge remote-tracking branch 'origin/master' into feature/decomp
Something about the merge from master makes it so the new tests for Honeywell and QCI executables fail when run against the resource estimator. By skipping these tests temporarily, I can at least be unblocked to continue development.
This change splits all the intrinsics and decompositions defined in QsharpCore out into their own files to allow them to be individually combined into a target definition package.

 Q# should include decompositions to alternate quantum gate sets #249
…tiQubit.qs

Co-authored-by: Sarah Marshall <33814365+samarsha@users.noreply.github.com>
This changes continues building on the work in feature/decomp to enable targeting alternate gate sets via packages specifying the supported set of intrinsics and decompositions for that gate set. This introduces Type2, which targets a set of intrinsics that includes SWAP and the 3 Pauli Ising gates. It also adds support for executing against this target package in the QDK simulator, and shares some of the existing intrinsic unitary tests to validate behavior of the package.

See #249 for the rundown on what work is part of this overall feature.
This change adds the Type1 target package for Q# targets that support a limited number of control operations. The change includes support for simulating a Type1 package and tests that verify unitary gate behavior for that package. This part of the ongoing work described in #249.

Co-authored-by: Chris Granade <chgranad@microsoft.com>
Co-authored-by: Sarah Marshall <33814365+samarsha@users.noreply.github.com>
swernli and others added 23 commits October 21, 2020 14:49
Merge main and clean-up project references
Updates/fixes to decomposition feature branch
Fixing negative exponentiation in ExpFrac
@IrinaYatsenko
Copy link
Contributor Author

Oops. Wrong branch. Will republish the PR in a moment.

@IrinaYatsenko IrinaYatsenko deleted the irinayat/nsim-prep-state3 branch November 10, 2020 17:05
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.

3 participants