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

Conversation

@msoeken
Copy link
Member

@msoeken msoeken commented Sep 7, 2020

I refactored QuantumROM to (i) incorporate the changes planned in #212 and (ii) to allow the preparation of additional data with the concrete example of preparing the sign of the passed coefficients.

I also updated Chemistry and MachineLearning projects to adjust to the new changes.

msoeken added 20 commits August 31, 2020 14:15
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.
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.
commit cde7c0c
Author: Mathias Soeken <masoeken@microsoft.com>
Date:   Mon Aug 31 16:34:40 2020 +0200

    Unzipped function.
@msoeken msoeken requested review from cgranade and guenp September 7, 2020 10:09
// Uncompute flag qubit.
(ControlledOnBitString(bits, X))(qubits!, flag);
Reset(flag);
operation AssertSignedProbInt(stateIndex : Int, expected : Double, sign : Qubit, qubits : LittleEndian, tolerance : Double) : Unit {
Copy link

Choose a reason for hiding this comment

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

Would it be useful to add a docstring here?

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks, there should be a doctoring here. I'll add it with the next commit.

Copy link
Contributor

Choose a reason for hiding this comment

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

Deferring to the next PR as part of completing work on #344.

@cgranade cgranade merged commit faf5814 into feature/state-preparation Nov 16, 2020
@cgranade cgranade deleted the msoeken/state-preparation-sign branch November 16, 2020 18:38
cgranade pushed a commit that referenced this pull request Nov 18, 2020
* Cleanup in M.Q.Preparation (#315)

* 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>

* Fix namespace.

* Extend PurifiedMixedState for additional data preparation (#322)

* 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>

* Implement last changes from #344 (#375)

* 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>

* Apply suggestions from code review

Co-authored-by: Guen P <guenp@microsoft.com>

* Apply suggestions from code review

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

Co-authored-by: Mathias Soeken <mathias.soeken@outlook.com>
Co-authored-by: Mathias Soeken <masoeken@microsoft.com>
Co-authored-by: Guen P <guenp@microsoft.com>
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.

4 participants