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

Conversation

@cgranade
Copy link
Contributor

This PR merges the Microsoft.Quantum.Preparation improvements feature branch into main.

Completes #344.

Most of the code here has been reviewed already, but this PR does include some deferred action items based on feedback from @guenp.

msoeken and others added 7 commits September 3, 2020 11:53
* Cleanup QuantumROM.

* Cleanup uniform superposition.

* Cleanup quantum ROM.

* Clean-up arbitrary state preparation.

* Cleanup remaining files.

* Fix bug in QuantumROM.

* Fix error.

* Revert name due to #239.

* Apply suggestions from code review

Co-authored-by: Chris Granade <chgranad@microsoft.com>

* Addressing reviewer comments.

* Docs.

Co-authored-by: Mathias Soeken <masoeken@microsoft.com>
Co-authored-by: Chris Granade <chgranad@microsoft.com>
Merge main into feature/state-prep
* Squashed commit of the following:

commit 9841567
Author: Mathias Soeken <masoeken@microsoft.com>
Date:   Mon Aug 31 10:41:17 2020 +0200

    Fix bug in QuantumROM.

commit 9726ff2
Merge: 58d428e 0b02a6a
Author: Mathias Soeken <masoeken@microsoft.com>
Date:   Mon Aug 31 09:49:43 2020 +0200

    Merge branch 'master' into msoeken/state-preparation-cleanup

commit 58d428e
Author: Mathias Soeken <masoeken@microsoft.com>
Date:   Thu Aug 27 11:59:12 2020 +0200

    Cleanup remaining files.

commit b35222a
Author: Mathias Soeken <masoeken@microsoft.com>
Date:   Thu Aug 27 11:54:33 2020 +0200

    Clean-up arbitrary state preparation.

commit e8076f7
Author: Mathias Soeken <masoeken@microsoft.com>
Date:   Wed Aug 26 09:31:17 2020 +0200

    Cleanup quantum ROM.

commit 860c0ab
Author: Mathias Soeken <masoeken@microsoft.com>
Date:   Wed Aug 26 09:21:21 2020 +0200

    Cleanup uniform superposition.

commit b94ec8c
Author: Mathias Soeken <masoeken@microsoft.com>
Date:   Tue Aug 25 15:56:26 2020 +0200

    Cleanup QuantumROM.

* Remove duplicate code and reduce T-count.

* Cleanup.

* Squashed commit of the following:

commit cb77faa
Author: Mathias Soeken <masoeken@microsoft.com>
Date:   Mon Aug 31 16:46:12 2020 +0200

    Fix error.

commit 9841567
Author: Mathias Soeken <masoeken@microsoft.com>
Date:   Mon Aug 31 10:41:17 2020 +0200

    Fix bug in QuantumROM.

commit 9726ff2
Merge: 58d428e 0b02a6a
Author: Mathias Soeken <masoeken@microsoft.com>
Date:   Mon Aug 31 09:49:43 2020 +0200

    Merge branch 'master' into msoeken/state-preparation-cleanup

commit 58d428e
Author: Mathias Soeken <masoeken@microsoft.com>
Date:   Thu Aug 27 11:59:12 2020 +0200

    Cleanup remaining files.

commit b35222a
Author: Mathias Soeken <masoeken@microsoft.com>
Date:   Thu Aug 27 11:54:33 2020 +0200

    Clean-up arbitrary state preparation.

commit e8076f7
Author: Mathias Soeken <masoeken@microsoft.com>
Date:   Wed Aug 26 09:31:17 2020 +0200

    Cleanup quantum ROM.

commit 860c0ab
Author: Mathias Soeken <masoeken@microsoft.com>
Date:   Wed Aug 26 09:21:21 2020 +0200

    Cleanup uniform superposition.

commit b94ec8c
Author: Mathias Soeken <masoeken@microsoft.com>
Date:   Tue Aug 25 15:56:26 2020 +0200

    Cleanup QuantumROM.

* Squashed commit of the following:

commit cde7c0c
Author: Mathias Soeken <masoeken@microsoft.com>
Date:   Mon Aug 31 16:34:40 2020 +0200

    Unzipped function.

* Preparing function and tests for QuantumROM with signed coefficients.

* Further unification.

* Ineffecient way of creating sign bit.

* Embed sign computation in multiplex.

* Picking changes from #212.

* Changes from #212.

* Generalize.

* Generalize data register.

* Unifying signatures.

* Use UDT for PurifiedState.

* Docs and cleanup.

* Incoprate API changes.

* Fix bug on Mac.

* Make public because of #239.

* Add deprecated functions.

Co-authored-by: Mathias Soeken <masoeken@microsoft.com>
Co-authored-by: Chris Granade <chgranad@microsoft.com>
* Implemented changes from #344 review.

* Ported signed quantum ROM test to use WithData.

* Made AssertSignedProbInt internal until #337.

* Apply suggestions from code review

Co-authored-by: Mathias Soeken <mathias.soeken@outlook.com>

Co-authored-by: Mathias Soeken <mathias.soeken@outlook.com>
@cgranade cgranade requested review from guenp and msoeken November 17, 2020 17:31
@cgranade cgranade added this to the November 2020 milestone Nov 17, 2020
@cgranade cgranade linked an issue Nov 17, 2020 that may be closed by this pull request
Copy link

@guenp guenp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just some small suggestions; otherwise looks good. Thank you and @msoeken for the great work on this!


/// # Summary
/// Prepares the Choi–Jamiłkowski state for a given operation onto given reference
/// Prepares the Choi–Jamiołkowski state for a given operation onto given reference
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch 👍

@@ -1,4 +1,4 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shoud we rename this file PurifiedMixedState.qs?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Possibly, yes, though thankfully the filename doesn't affect the public API such that I think we can change the filename at our leisure.

Copy link
Member

@msoeken msoeken left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. Thanks! Just noticed some spelling and formatting issues.

if(nIndices == 0) {
fail $"Cannot prepare uniform superposition over {nIndices} state.";
operation PrepareUniformSuperposition(nIndices: Int, indexRegister: LittleEndian)
: Unit is Adj+Ctl {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
: Unit is Adj+Ctl {
: Unit is Adj + Ctl {

Co-authored-by: Mathias Soeken <mathias.soeken@outlook.com>
@cgranade cgranade merged commit f7ee333 into main Nov 18, 2020
@cgranade cgranade deleted the feature/state-preparation branch November 18, 2020 21:13
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.

Enhancements to Microsoft.Quantum.Preparation namespace

4 participants