QuantumLibraries/Standard/tests/ArrayTests.qs

366 строки
15 KiB
Plaintext
Исходник Постоянная ссылка Обычный вид История

// Copyright (c) Microsoft Corporation.
Release v0.6 to master. (#98) * Begin refactoring standard libraries (#39) * Began splitting up namespaces. * Began refactoring tests. * Updated chemistry src and tests for new namespaces. * Remove unused opens. * Began renaming operations and functions. * Separated out and updated ApplyReversed*. * Updated BE ↔ LE type conversions. * Added new transformed operation fns. * Whitespace fix * Eliminated some redundant code in applyreversed * Fixed deprecation comments. * Began working on refactoring With. * Refactored With further. * More renaming for consistency with LE/BE suffix convention. * Added Zip3, Zip4 * Added shorthand for MAJ and updated some type conv. * Fixed a typo in Zip4. * Separated out and updated arithmetic measurements. * Other minor maintenance changes. * Started separating out modular arithmetic. * Began refactoring ripple-carry comparators. * Refactored integer increment operations. * Fixed some See Also blocks. * Some minor progress. * Moved new arithmetic functionality into right folders. * Renamed integer arithmetic namespaces. * Split out qecc namespace. * Added documentation file for Microsoft.Quantum.ErrorCorrection. * Progress on renaming type conversion functions. * More progress on updating type conversion names. * Split out AA namespace. * Split out oracles namespace as well. * Renamed UDTs to remove "AmpAmp" prefix. This prefix is now implied by the Microsoft.Quantum.AmplitudeAmplification namespace. * Renamed some Qecc operations/fns * Moved more conversions into Convert.qs. * Updated some deprecated syntax. * Split out M.Q.Convert. * Added missing open stmt. * Started separating out classical math. * Began separating out QCVV. * Fixing namespaces in tests. * Update to use new docgen. * Began making arrays namespace. * Updated to use new arrays and diagnostics namespaces. * Updated names for claims * Started extracting measurements from Paulis.qs. * Updated namespaces in tests as well. * Updating chemistry for most recent changes. * Added ForEach, used to simplify measurements. * Updating deprecated Q# syntax. * Minor fix for XML error. * Fixed infinite recursion in deprecation stubs. * Started trying to reduce # of warnings. * Fixed some minor build errors. * Resolved a couple TODOs. * Removed BigEndian support. * Resolved warnings due to && and ||. * Update Standard/src/Arithmetic/Shorthand.qs Co-Authored-By: cgranade <cgranade@gmail.com> * Addressing feedback. * Claim → Fact * Moved MeasureInteger back to Microsoft.Quantum.Arithmetic. * Resolved more deprecated syntax. * Removed one more LE suffix. * Addressing feedback. * Cgranade/complete 0.6 move (#57) * Revert "Begin refactoring standard libraries (#39)" (#56) As Chris pointed out, reverting these breaking changes until we have a chance to change everything... * Complete move of standard library refactoring to release branch This reverts commit 058048983c4d0509e5d522888d3d47ae49cd300e. * Explicitly qualify all names in M.Q.Ext.Math. (#74) * Explicitly qualify all names in M.Q.Ext.Math. * Fixed two missing qualified names. * Removed more occurances of M.Q.Ext.Math. * Removed Microsoft.Quantum.Extensions.Math from tests as well. * Reverted slight change to QuantumROM. * New array functions (#75) * Added new IndexRange function to eliminate `-1` in for loops. * Added some missing open statements. * New Enumerated function. * Port library and test code to new 0.6 names to reduce warning count. (#72) * Updating to use new syntax, namespace names, etc. * More primitive → intrinsic. * Updated test project to use beta version. * Updated chemistry proiects to beta. * Finding a few more calls to deprecated fns. * Cleaned up some assert and qcvv tests. * Removed uses of deprecated IntArrayFromRange * Resolved some more deprecated functions and ops. * Minor maintenance in QubitizationTests. * Bumped versions to latest beta. * Some trivial change to retrigger build. * Resolved package downgrade. * Move Microsoft.Quantum.Math.Complex UDT and resolve Microsoft.Quantum.Diagnostics deprecation stubs. (#77) * More primitive → intrinsic. * Finding a few more calls to deprecated fns. * Resolved some more deprecated functions and ops. * Minor maintenance in QubitizationTests. * Bumped versions to latest beta. * Resolved package downgrade. * Use Complex UDT at its new name. * Adapted tests. * A few more test adaptations. * Updated name of AssertQubitState to 0.6 name. * Fixes to chemistry. * Getting updates from master (#80) * Revert "Begin refactoring standard libraries (#39)" (#56) As Chris pointed out, reverting these breaking changes until we have a chance to change everything... * Missing return statement when compiling more than one Q# snippet from Python. (#60) * Fixing bug * Adding tests * Change Assembly.Version to Python.Version. (#64) * Prevent loading Q# modules when Python client is busy. (#71) * Prevent loading Q# modules when Python client is busy. * Linux build failed with some unrelated problem. Committing. * modifying contructor calls for QArray in preparation for a simulation framework change (#78) * Revert "Revert "Begin refactoring standard libraries (#39)" (#56)" This reverts commit 058048983c4d0509e5d522888d3d47ae49cd300e. * Update to 0.6.1904.1302-beta. (#81) * Update to 0.6.1904.1302-beta. * Removed deprecation warnings for Microsoft.Quantum.Math. * Resolved a few more deprecations. * Resolved a few more deprecation warnings. * A few more deprecation resolutions. * Removed some duplicate namespace opens. * Slight code cleanup. * Addressed feedback from @bettinaheim. * Standard.sln builds again, Standard.sln builds (#84) * Gulow/v0.6 chemistry deprecation (#82) * Update to 0.6.1904.1302-beta. * Removed deprecation warnings for Microsoft.Quantum.Math. * Resolved a few more deprecations. * Resolved a few more deprecation warnings. * A few more deprecation resolutions. * Removed some duplicate namespace opens. * Slight code cleanup. * Update test * . * Remove deprecated operations from chemistry and dependencies. * Fix comments * Update to use 0.65 syntax from latest beta. (#87) * Ported stateprep.qs to 0.65 syntax. * Fixed deprecation in test. * Updated to latest beta. * Fix mutable array issue in chemistry data model. (#88) * Explicitly call new QArray. (#89) * do not rely on collections.immutable (#93) * Continue migrating libraries to Q# 0.6 (#91) * Continue migrating to 0.65 syntax and applying style guidance. * A bit more progress normalizing private names. * Resolved more deprecated syntax, updated a name. * Resolved some more syntax warnings. * Ported more syntax and updated more names. * Resolved all remaining compile-time warnings in Standard. * Addressed all Q#-level compile-time warnings in chem. * Migrated a bit more syntax and updated to newest beta. * Moved to using intrinsic warnings. * Fixed endianness of exact QFT. * Fixed Microsoft.Quantum.Warnings. * Addressing @bettinaheim's feedback. * Removed some warnings in unit tests. * Adding DocsOutDir for single doc output location across projects. (#94) * Adding DocsOutDir for single doc output location across projects. * Begin adding more classical math functions for BigInt. (#96) * Begin adding more classical math functions for BigInt. * Addressing @beheim's feedback. * Minor fixes. * Bump to latest beta. * Fixed two minor bugs. * Fixed the type of signs. * Bump version to released packages.
2019-05-04 01:44:41 +03:00
// Licensed under the MIT License.
namespace Microsoft.Quantum.Tests {
open Microsoft.Quantum.Arrays;
Release v0.6 to master. (#98) * Begin refactoring standard libraries (#39) * Began splitting up namespaces. * Began refactoring tests. * Updated chemistry src and tests for new namespaces. * Remove unused opens. * Began renaming operations and functions. * Separated out and updated ApplyReversed*. * Updated BE ↔ LE type conversions. * Added new transformed operation fns. * Whitespace fix * Eliminated some redundant code in applyreversed * Fixed deprecation comments. * Began working on refactoring With. * Refactored With further. * More renaming for consistency with LE/BE suffix convention. * Added Zip3, Zip4 * Added shorthand for MAJ and updated some type conv. * Fixed a typo in Zip4. * Separated out and updated arithmetic measurements. * Other minor maintenance changes. * Started separating out modular arithmetic. * Began refactoring ripple-carry comparators. * Refactored integer increment operations. * Fixed some See Also blocks. * Some minor progress. * Moved new arithmetic functionality into right folders. * Renamed integer arithmetic namespaces. * Split out qecc namespace. * Added documentation file for Microsoft.Quantum.ErrorCorrection. * Progress on renaming type conversion functions. * More progress on updating type conversion names. * Split out AA namespace. * Split out oracles namespace as well. * Renamed UDTs to remove "AmpAmp" prefix. This prefix is now implied by the Microsoft.Quantum.AmplitudeAmplification namespace. * Renamed some Qecc operations/fns * Moved more conversions into Convert.qs. * Updated some deprecated syntax. * Split out M.Q.Convert. * Added missing open stmt. * Started separating out classical math. * Began separating out QCVV. * Fixing namespaces in tests. * Update to use new docgen. * Began making arrays namespace. * Updated to use new arrays and diagnostics namespaces. * Updated names for claims * Started extracting measurements from Paulis.qs. * Updated namespaces in tests as well. * Updating chemistry for most recent changes. * Added ForEach, used to simplify measurements. * Updating deprecated Q# syntax. * Minor fix for XML error. * Fixed infinite recursion in deprecation stubs. * Started trying to reduce # of warnings. * Fixed some minor build errors. * Resolved a couple TODOs. * Removed BigEndian support. * Resolved warnings due to && and ||. * Update Standard/src/Arithmetic/Shorthand.qs Co-Authored-By: cgranade <cgranade@gmail.com> * Addressing feedback. * Claim → Fact * Moved MeasureInteger back to Microsoft.Quantum.Arithmetic. * Resolved more deprecated syntax. * Removed one more LE suffix. * Addressing feedback. * Cgranade/complete 0.6 move (#57) * Revert "Begin refactoring standard libraries (#39)" (#56) As Chris pointed out, reverting these breaking changes until we have a chance to change everything... * Complete move of standard library refactoring to release branch This reverts commit 058048983c4d0509e5d522888d3d47ae49cd300e. * Explicitly qualify all names in M.Q.Ext.Math. (#74) * Explicitly qualify all names in M.Q.Ext.Math. * Fixed two missing qualified names. * Removed more occurances of M.Q.Ext.Math. * Removed Microsoft.Quantum.Extensions.Math from tests as well. * Reverted slight change to QuantumROM. * New array functions (#75) * Added new IndexRange function to eliminate `-1` in for loops. * Added some missing open statements. * New Enumerated function. * Port library and test code to new 0.6 names to reduce warning count. (#72) * Updating to use new syntax, namespace names, etc. * More primitive → intrinsic. * Updated test project to use beta version. * Updated chemistry proiects to beta. * Finding a few more calls to deprecated fns. * Cleaned up some assert and qcvv tests. * Removed uses of deprecated IntArrayFromRange * Resolved some more deprecated functions and ops. * Minor maintenance in QubitizationTests. * Bumped versions to latest beta. * Some trivial change to retrigger build. * Resolved package downgrade. * Move Microsoft.Quantum.Math.Complex UDT and resolve Microsoft.Quantum.Diagnostics deprecation stubs. (#77) * More primitive → intrinsic. * Finding a few more calls to deprecated fns. * Resolved some more deprecated functions and ops. * Minor maintenance in QubitizationTests. * Bumped versions to latest beta. * Resolved package downgrade. * Use Complex UDT at its new name. * Adapted tests. * A few more test adaptations. * Updated name of AssertQubitState to 0.6 name. * Fixes to chemistry. * Getting updates from master (#80) * Revert "Begin refactoring standard libraries (#39)" (#56) As Chris pointed out, reverting these breaking changes until we have a chance to change everything... * Missing return statement when compiling more than one Q# snippet from Python. (#60) * Fixing bug * Adding tests * Change Assembly.Version to Python.Version. (#64) * Prevent loading Q# modules when Python client is busy. (#71) * Prevent loading Q# modules when Python client is busy. * Linux build failed with some unrelated problem. Committing. * modifying contructor calls for QArray in preparation for a simulation framework change (#78) * Revert "Revert "Begin refactoring standard libraries (#39)" (#56)" This reverts commit 058048983c4d0509e5d522888d3d47ae49cd300e. * Update to 0.6.1904.1302-beta. (#81) * Update to 0.6.1904.1302-beta. * Removed deprecation warnings for Microsoft.Quantum.Math. * Resolved a few more deprecations. * Resolved a few more deprecation warnings. * A few more deprecation resolutions. * Removed some duplicate namespace opens. * Slight code cleanup. * Addressed feedback from @bettinaheim. * Standard.sln builds again, Standard.sln builds (#84) * Gulow/v0.6 chemistry deprecation (#82) * Update to 0.6.1904.1302-beta. * Removed deprecation warnings for Microsoft.Quantum.Math. * Resolved a few more deprecations. * Resolved a few more deprecation warnings. * A few more deprecation resolutions. * Removed some duplicate namespace opens. * Slight code cleanup. * Update test * . * Remove deprecated operations from chemistry and dependencies. * Fix comments * Update to use 0.65 syntax from latest beta. (#87) * Ported stateprep.qs to 0.65 syntax. * Fixed deprecation in test. * Updated to latest beta. * Fix mutable array issue in chemistry data model. (#88) * Explicitly call new QArray. (#89) * do not rely on collections.immutable (#93) * Continue migrating libraries to Q# 0.6 (#91) * Continue migrating to 0.65 syntax and applying style guidance. * A bit more progress normalizing private names. * Resolved more deprecated syntax, updated a name. * Resolved some more syntax warnings. * Ported more syntax and updated more names. * Resolved all remaining compile-time warnings in Standard. * Addressed all Q#-level compile-time warnings in chem. * Migrated a bit more syntax and updated to newest beta. * Moved to using intrinsic warnings. * Fixed endianness of exact QFT. * Fixed Microsoft.Quantum.Warnings. * Addressing @bettinaheim's feedback. * Removed some warnings in unit tests. * Adding DocsOutDir for single doc output location across projects. (#94) * Adding DocsOutDir for single doc output location across projects. * Begin adding more classical math functions for BigInt. (#96) * Begin adding more classical math functions for BigInt. * Addressing @beheim's feedback. * Minor fixes. * Bump to latest beta. * Fixed two minor bugs. * Fixed the type of signs. * Bump version to released packages.
2019-05-04 01:44:41 +03:00
open Microsoft.Quantum.Canon;
open Microsoft.Quantum.Diagnostics;
Release v0.6 to master. (#98) * Begin refactoring standard libraries (#39) * Began splitting up namespaces. * Began refactoring tests. * Updated chemistry src and tests for new namespaces. * Remove unused opens. * Began renaming operations and functions. * Separated out and updated ApplyReversed*. * Updated BE ↔ LE type conversions. * Added new transformed operation fns. * Whitespace fix * Eliminated some redundant code in applyreversed * Fixed deprecation comments. * Began working on refactoring With. * Refactored With further. * More renaming for consistency with LE/BE suffix convention. * Added Zip3, Zip4 * Added shorthand for MAJ and updated some type conv. * Fixed a typo in Zip4. * Separated out and updated arithmetic measurements. * Other minor maintenance changes. * Started separating out modular arithmetic. * Began refactoring ripple-carry comparators. * Refactored integer increment operations. * Fixed some See Also blocks. * Some minor progress. * Moved new arithmetic functionality into right folders. * Renamed integer arithmetic namespaces. * Split out qecc namespace. * Added documentation file for Microsoft.Quantum.ErrorCorrection. * Progress on renaming type conversion functions. * More progress on updating type conversion names. * Split out AA namespace. * Split out oracles namespace as well. * Renamed UDTs to remove "AmpAmp" prefix. This prefix is now implied by the Microsoft.Quantum.AmplitudeAmplification namespace. * Renamed some Qecc operations/fns * Moved more conversions into Convert.qs. * Updated some deprecated syntax. * Split out M.Q.Convert. * Added missing open stmt. * Started separating out classical math. * Began separating out QCVV. * Fixing namespaces in tests. * Update to use new docgen. * Began making arrays namespace. * Updated to use new arrays and diagnostics namespaces. * Updated names for claims * Started extracting measurements from Paulis.qs. * Updated namespaces in tests as well. * Updating chemistry for most recent changes. * Added ForEach, used to simplify measurements. * Updating deprecated Q# syntax. * Minor fix for XML error. * Fixed infinite recursion in deprecation stubs. * Started trying to reduce # of warnings. * Fixed some minor build errors. * Resolved a couple TODOs. * Removed BigEndian support. * Resolved warnings due to && and ||. * Update Standard/src/Arithmetic/Shorthand.qs Co-Authored-By: cgranade <cgranade@gmail.com> * Addressing feedback. * Claim → Fact * Moved MeasureInteger back to Microsoft.Quantum.Arithmetic. * Resolved more deprecated syntax. * Removed one more LE suffix. * Addressing feedback. * Cgranade/complete 0.6 move (#57) * Revert "Begin refactoring standard libraries (#39)" (#56) As Chris pointed out, reverting these breaking changes until we have a chance to change everything... * Complete move of standard library refactoring to release branch This reverts commit 058048983c4d0509e5d522888d3d47ae49cd300e. * Explicitly qualify all names in M.Q.Ext.Math. (#74) * Explicitly qualify all names in M.Q.Ext.Math. * Fixed two missing qualified names. * Removed more occurances of M.Q.Ext.Math. * Removed Microsoft.Quantum.Extensions.Math from tests as well. * Reverted slight change to QuantumROM. * New array functions (#75) * Added new IndexRange function to eliminate `-1` in for loops. * Added some missing open statements. * New Enumerated function. * Port library and test code to new 0.6 names to reduce warning count. (#72) * Updating to use new syntax, namespace names, etc. * More primitive → intrinsic. * Updated test project to use beta version. * Updated chemistry proiects to beta. * Finding a few more calls to deprecated fns. * Cleaned up some assert and qcvv tests. * Removed uses of deprecated IntArrayFromRange * Resolved some more deprecated functions and ops. * Minor maintenance in QubitizationTests. * Bumped versions to latest beta. * Some trivial change to retrigger build. * Resolved package downgrade. * Move Microsoft.Quantum.Math.Complex UDT and resolve Microsoft.Quantum.Diagnostics deprecation stubs. (#77) * More primitive → intrinsic. * Finding a few more calls to deprecated fns. * Resolved some more deprecated functions and ops. * Minor maintenance in QubitizationTests. * Bumped versions to latest beta. * Resolved package downgrade. * Use Complex UDT at its new name. * Adapted tests. * A few more test adaptations. * Updated name of AssertQubitState to 0.6 name. * Fixes to chemistry. * Getting updates from master (#80) * Revert "Begin refactoring standard libraries (#39)" (#56) As Chris pointed out, reverting these breaking changes until we have a chance to change everything... * Missing return statement when compiling more than one Q# snippet from Python. (#60) * Fixing bug * Adding tests * Change Assembly.Version to Python.Version. (#64) * Prevent loading Q# modules when Python client is busy. (#71) * Prevent loading Q# modules when Python client is busy. * Linux build failed with some unrelated problem. Committing. * modifying contructor calls for QArray in preparation for a simulation framework change (#78) * Revert "Revert "Begin refactoring standard libraries (#39)" (#56)" This reverts commit 058048983c4d0509e5d522888d3d47ae49cd300e. * Update to 0.6.1904.1302-beta. (#81) * Update to 0.6.1904.1302-beta. * Removed deprecation warnings for Microsoft.Quantum.Math. * Resolved a few more deprecations. * Resolved a few more deprecation warnings. * A few more deprecation resolutions. * Removed some duplicate namespace opens. * Slight code cleanup. * Addressed feedback from @bettinaheim. * Standard.sln builds again, Standard.sln builds (#84) * Gulow/v0.6 chemistry deprecation (#82) * Update to 0.6.1904.1302-beta. * Removed deprecation warnings for Microsoft.Quantum.Math. * Resolved a few more deprecations. * Resolved a few more deprecation warnings. * A few more deprecation resolutions. * Removed some duplicate namespace opens. * Slight code cleanup. * Update test * . * Remove deprecated operations from chemistry and dependencies. * Fix comments * Update to use 0.65 syntax from latest beta. (#87) * Ported stateprep.qs to 0.65 syntax. * Fixed deprecation in test. * Updated to latest beta. * Fix mutable array issue in chemistry data model. (#88) * Explicitly call new QArray. (#89) * do not rely on collections.immutable (#93) * Continue migrating libraries to Q# 0.6 (#91) * Continue migrating to 0.65 syntax and applying style guidance. * A bit more progress normalizing private names. * Resolved more deprecated syntax, updated a name. * Resolved some more syntax warnings. * Ported more syntax and updated more names. * Resolved all remaining compile-time warnings in Standard. * Addressed all Q#-level compile-time warnings in chem. * Migrated a bit more syntax and updated to newest beta. * Moved to using intrinsic warnings. * Fixed endianness of exact QFT. * Fixed Microsoft.Quantum.Warnings. * Addressing @bettinaheim's feedback. * Removed some warnings in unit tests. * Adding DocsOutDir for single doc output location across projects. (#94) * Adding DocsOutDir for single doc output location across projects. * Begin adding more classical math functions for BigInt. (#96) * Begin adding more classical math functions for BigInt. * Addressing @beheim's feedback. * Minor fixes. * Bump to latest beta. * Fixed two minor bugs. * Fixed the type of signs. * Bump version to released packages.
2019-05-04 01:44:41 +03:00
open Microsoft.Quantum.Intrinsic;
open Microsoft.Quantum.Logical;
open Microsoft.Quantum.Math;
2019-11-22 22:25:20 +03:00
@Test("QuantumSimulator")
function TestZipped() : Unit {
Release v0.6 to master. (#98) * Begin refactoring standard libraries (#39) * Began splitting up namespaces. * Began refactoring tests. * Updated chemistry src and tests for new namespaces. * Remove unused opens. * Began renaming operations and functions. * Separated out and updated ApplyReversed*. * Updated BE ↔ LE type conversions. * Added new transformed operation fns. * Whitespace fix * Eliminated some redundant code in applyreversed * Fixed deprecation comments. * Began working on refactoring With. * Refactored With further. * More renaming for consistency with LE/BE suffix convention. * Added Zip3, Zip4 * Added shorthand for MAJ and updated some type conv. * Fixed a typo in Zip4. * Separated out and updated arithmetic measurements. * Other minor maintenance changes. * Started separating out modular arithmetic. * Began refactoring ripple-carry comparators. * Refactored integer increment operations. * Fixed some See Also blocks. * Some minor progress. * Moved new arithmetic functionality into right folders. * Renamed integer arithmetic namespaces. * Split out qecc namespace. * Added documentation file for Microsoft.Quantum.ErrorCorrection. * Progress on renaming type conversion functions. * More progress on updating type conversion names. * Split out AA namespace. * Split out oracles namespace as well. * Renamed UDTs to remove "AmpAmp" prefix. This prefix is now implied by the Microsoft.Quantum.AmplitudeAmplification namespace. * Renamed some Qecc operations/fns * Moved more conversions into Convert.qs. * Updated some deprecated syntax. * Split out M.Q.Convert. * Added missing open stmt. * Started separating out classical math. * Began separating out QCVV. * Fixing namespaces in tests. * Update to use new docgen. * Began making arrays namespace. * Updated to use new arrays and diagnostics namespaces. * Updated names for claims * Started extracting measurements from Paulis.qs. * Updated namespaces in tests as well. * Updating chemistry for most recent changes. * Added ForEach, used to simplify measurements. * Updating deprecated Q# syntax. * Minor fix for XML error. * Fixed infinite recursion in deprecation stubs. * Started trying to reduce # of warnings. * Fixed some minor build errors. * Resolved a couple TODOs. * Removed BigEndian support. * Resolved warnings due to && and ||. * Update Standard/src/Arithmetic/Shorthand.qs Co-Authored-By: cgranade <cgranade@gmail.com> * Addressing feedback. * Claim → Fact * Moved MeasureInteger back to Microsoft.Quantum.Arithmetic. * Resolved more deprecated syntax. * Removed one more LE suffix. * Addressing feedback. * Cgranade/complete 0.6 move (#57) * Revert "Begin refactoring standard libraries (#39)" (#56) As Chris pointed out, reverting these breaking changes until we have a chance to change everything... * Complete move of standard library refactoring to release branch This reverts commit 058048983c4d0509e5d522888d3d47ae49cd300e. * Explicitly qualify all names in M.Q.Ext.Math. (#74) * Explicitly qualify all names in M.Q.Ext.Math. * Fixed two missing qualified names. * Removed more occurances of M.Q.Ext.Math. * Removed Microsoft.Quantum.Extensions.Math from tests as well. * Reverted slight change to QuantumROM. * New array functions (#75) * Added new IndexRange function to eliminate `-1` in for loops. * Added some missing open statements. * New Enumerated function. * Port library and test code to new 0.6 names to reduce warning count. (#72) * Updating to use new syntax, namespace names, etc. * More primitive → intrinsic. * Updated test project to use beta version. * Updated chemistry proiects to beta. * Finding a few more calls to deprecated fns. * Cleaned up some assert and qcvv tests. * Removed uses of deprecated IntArrayFromRange * Resolved some more deprecated functions and ops. * Minor maintenance in QubitizationTests. * Bumped versions to latest beta. * Some trivial change to retrigger build. * Resolved package downgrade. * Move Microsoft.Quantum.Math.Complex UDT and resolve Microsoft.Quantum.Diagnostics deprecation stubs. (#77) * More primitive → intrinsic. * Finding a few more calls to deprecated fns. * Resolved some more deprecated functions and ops. * Minor maintenance in QubitizationTests. * Bumped versions to latest beta. * Resolved package downgrade. * Use Complex UDT at its new name. * Adapted tests. * A few more test adaptations. * Updated name of AssertQubitState to 0.6 name. * Fixes to chemistry. * Getting updates from master (#80) * Revert "Begin refactoring standard libraries (#39)" (#56) As Chris pointed out, reverting these breaking changes until we have a chance to change everything... * Missing return statement when compiling more than one Q# snippet from Python. (#60) * Fixing bug * Adding tests * Change Assembly.Version to Python.Version. (#64) * Prevent loading Q# modules when Python client is busy. (#71) * Prevent loading Q# modules when Python client is busy. * Linux build failed with some unrelated problem. Committing. * modifying contructor calls for QArray in preparation for a simulation framework change (#78) * Revert "Revert "Begin refactoring standard libraries (#39)" (#56)" This reverts commit 058048983c4d0509e5d522888d3d47ae49cd300e. * Update to 0.6.1904.1302-beta. (#81) * Update to 0.6.1904.1302-beta. * Removed deprecation warnings for Microsoft.Quantum.Math. * Resolved a few more deprecations. * Resolved a few more deprecation warnings. * A few more deprecation resolutions. * Removed some duplicate namespace opens. * Slight code cleanup. * Addressed feedback from @bettinaheim. * Standard.sln builds again, Standard.sln builds (#84) * Gulow/v0.6 chemistry deprecation (#82) * Update to 0.6.1904.1302-beta. * Removed deprecation warnings for Microsoft.Quantum.Math. * Resolved a few more deprecations. * Resolved a few more deprecation warnings. * A few more deprecation resolutions. * Removed some duplicate namespace opens. * Slight code cleanup. * Update test * . * Remove deprecated operations from chemistry and dependencies. * Fix comments * Update to use 0.65 syntax from latest beta. (#87) * Ported stateprep.qs to 0.65 syntax. * Fixed deprecation in test. * Updated to latest beta. * Fix mutable array issue in chemistry data model. (#88) * Explicitly call new QArray. (#89) * do not rely on collections.immutable (#93) * Continue migrating libraries to Q# 0.6 (#91) * Continue migrating to 0.65 syntax and applying style guidance. * A bit more progress normalizing private names. * Resolved more deprecated syntax, updated a name. * Resolved some more syntax warnings. * Ported more syntax and updated more names. * Resolved all remaining compile-time warnings in Standard. * Addressed all Q#-level compile-time warnings in chem. * Migrated a bit more syntax and updated to newest beta. * Moved to using intrinsic warnings. * Fixed endianness of exact QFT. * Fixed Microsoft.Quantum.Warnings. * Addressing @bettinaheim's feedback. * Removed some warnings in unit tests. * Adding DocsOutDir for single doc output location across projects. (#94) * Adding DocsOutDir for single doc output location across projects. * Begin adding more classical math functions for BigInt. (#96) * Begin adding more classical math functions for BigInt. * Addressing @beheim's feedback. * Minor fixes. * Bump to latest beta. * Fixed two minor bugs. * Fixed the type of signs. * Bump version to released packages.
2019-05-04 01:44:41 +03:00
let left = [1, 2, 101];
let right = [PauliY, PauliI];
let zipped = Zipped(left, right);
Release v0.6 to master. (#98) * Begin refactoring standard libraries (#39) * Began splitting up namespaces. * Began refactoring tests. * Updated chemistry src and tests for new namespaces. * Remove unused opens. * Began renaming operations and functions. * Separated out and updated ApplyReversed*. * Updated BE ↔ LE type conversions. * Added new transformed operation fns. * Whitespace fix * Eliminated some redundant code in applyreversed * Fixed deprecation comments. * Began working on refactoring With. * Refactored With further. * More renaming for consistency with LE/BE suffix convention. * Added Zip3, Zip4 * Added shorthand for MAJ and updated some type conv. * Fixed a typo in Zip4. * Separated out and updated arithmetic measurements. * Other minor maintenance changes. * Started separating out modular arithmetic. * Began refactoring ripple-carry comparators. * Refactored integer increment operations. * Fixed some See Also blocks. * Some minor progress. * Moved new arithmetic functionality into right folders. * Renamed integer arithmetic namespaces. * Split out qecc namespace. * Added documentation file for Microsoft.Quantum.ErrorCorrection. * Progress on renaming type conversion functions. * More progress on updating type conversion names. * Split out AA namespace. * Split out oracles namespace as well. * Renamed UDTs to remove "AmpAmp" prefix. This prefix is now implied by the Microsoft.Quantum.AmplitudeAmplification namespace. * Renamed some Qecc operations/fns * Moved more conversions into Convert.qs. * Updated some deprecated syntax. * Split out M.Q.Convert. * Added missing open stmt. * Started separating out classical math. * Began separating out QCVV. * Fixing namespaces in tests. * Update to use new docgen. * Began making arrays namespace. * Updated to use new arrays and diagnostics namespaces. * Updated names for claims * Started extracting measurements from Paulis.qs. * Updated namespaces in tests as well. * Updating chemistry for most recent changes. * Added ForEach, used to simplify measurements. * Updating deprecated Q# syntax. * Minor fix for XML error. * Fixed infinite recursion in deprecation stubs. * Started trying to reduce # of warnings. * Fixed some minor build errors. * Resolved a couple TODOs. * Removed BigEndian support. * Resolved warnings due to && and ||. * Update Standard/src/Arithmetic/Shorthand.qs Co-Authored-By: cgranade <cgranade@gmail.com> * Addressing feedback. * Claim → Fact * Moved MeasureInteger back to Microsoft.Quantum.Arithmetic. * Resolved more deprecated syntax. * Removed one more LE suffix. * Addressing feedback. * Cgranade/complete 0.6 move (#57) * Revert "Begin refactoring standard libraries (#39)" (#56) As Chris pointed out, reverting these breaking changes until we have a chance to change everything... * Complete move of standard library refactoring to release branch This reverts commit 058048983c4d0509e5d522888d3d47ae49cd300e. * Explicitly qualify all names in M.Q.Ext.Math. (#74) * Explicitly qualify all names in M.Q.Ext.Math. * Fixed two missing qualified names. * Removed more occurances of M.Q.Ext.Math. * Removed Microsoft.Quantum.Extensions.Math from tests as well. * Reverted slight change to QuantumROM. * New array functions (#75) * Added new IndexRange function to eliminate `-1` in for loops. * Added some missing open statements. * New Enumerated function. * Port library and test code to new 0.6 names to reduce warning count. (#72) * Updating to use new syntax, namespace names, etc. * More primitive → intrinsic. * Updated test project to use beta version. * Updated chemistry proiects to beta. * Finding a few more calls to deprecated fns. * Cleaned up some assert and qcvv tests. * Removed uses of deprecated IntArrayFromRange * Resolved some more deprecated functions and ops. * Minor maintenance in QubitizationTests. * Bumped versions to latest beta. * Some trivial change to retrigger build. * Resolved package downgrade. * Move Microsoft.Quantum.Math.Complex UDT and resolve Microsoft.Quantum.Diagnostics deprecation stubs. (#77) * More primitive → intrinsic. * Finding a few more calls to deprecated fns. * Resolved some more deprecated functions and ops. * Minor maintenance in QubitizationTests. * Bumped versions to latest beta. * Resolved package downgrade. * Use Complex UDT at its new name. * Adapted tests. * A few more test adaptations. * Updated name of AssertQubitState to 0.6 name. * Fixes to chemistry. * Getting updates from master (#80) * Revert "Begin refactoring standard libraries (#39)" (#56) As Chris pointed out, reverting these breaking changes until we have a chance to change everything... * Missing return statement when compiling more than one Q# snippet from Python. (#60) * Fixing bug * Adding tests * Change Assembly.Version to Python.Version. (#64) * Prevent loading Q# modules when Python client is busy. (#71) * Prevent loading Q# modules when Python client is busy. * Linux build failed with some unrelated problem. Committing. * modifying contructor calls for QArray in preparation for a simulation framework change (#78) * Revert "Revert "Begin refactoring standard libraries (#39)" (#56)" This reverts commit 058048983c4d0509e5d522888d3d47ae49cd300e. * Update to 0.6.1904.1302-beta. (#81) * Update to 0.6.1904.1302-beta. * Removed deprecation warnings for Microsoft.Quantum.Math. * Resolved a few more deprecations. * Resolved a few more deprecation warnings. * A few more deprecation resolutions. * Removed some duplicate namespace opens. * Slight code cleanup. * Addressed feedback from @bettinaheim. * Standard.sln builds again, Standard.sln builds (#84) * Gulow/v0.6 chemistry deprecation (#82) * Update to 0.6.1904.1302-beta. * Removed deprecation warnings for Microsoft.Quantum.Math. * Resolved a few more deprecations. * Resolved a few more deprecation warnings. * A few more deprecation resolutions. * Removed some duplicate namespace opens. * Slight code cleanup. * Update test * . * Remove deprecated operations from chemistry and dependencies. * Fix comments * Update to use 0.65 syntax from latest beta. (#87) * Ported stateprep.qs to 0.65 syntax. * Fixed deprecation in test. * Updated to latest beta. * Fix mutable array issue in chemistry data model. (#88) * Explicitly call new QArray. (#89) * do not rely on collections.immutable (#93) * Continue migrating libraries to Q# 0.6 (#91) * Continue migrating to 0.65 syntax and applying style guidance. * A bit more progress normalizing private names. * Resolved more deprecated syntax, updated a name. * Resolved some more syntax warnings. * Ported more syntax and updated more names. * Resolved all remaining compile-time warnings in Standard. * Addressed all Q#-level compile-time warnings in chem. * Migrated a bit more syntax and updated to newest beta. * Moved to using intrinsic warnings. * Fixed endianness of exact QFT. * Fixed Microsoft.Quantum.Warnings. * Addressing @bettinaheim's feedback. * Removed some warnings in unit tests. * Adding DocsOutDir for single doc output location across projects. (#94) * Adding DocsOutDir for single doc output location across projects. * Begin adding more classical math functions for BigInt. (#96) * Begin adding more classical math functions for BigInt. * Addressing @beheim's feedback. * Minor fixes. * Bump to latest beta. * Fixed two minor bugs. * Fixed the type of signs. * Bump version to released packages.
2019-05-04 01:44:41 +03:00
let (leftActual1, rightActual1) = zipped[0];
2019-11-22 22:25:20 +03:00
if leftActual1 != 1 or rightActual1 != PauliY {
Release v0.6 to master. (#98) * Begin refactoring standard libraries (#39) * Began splitting up namespaces. * Began refactoring tests. * Updated chemistry src and tests for new namespaces. * Remove unused opens. * Began renaming operations and functions. * Separated out and updated ApplyReversed*. * Updated BE ↔ LE type conversions. * Added new transformed operation fns. * Whitespace fix * Eliminated some redundant code in applyreversed * Fixed deprecation comments. * Began working on refactoring With. * Refactored With further. * More renaming for consistency with LE/BE suffix convention. * Added Zip3, Zip4 * Added shorthand for MAJ and updated some type conv. * Fixed a typo in Zip4. * Separated out and updated arithmetic measurements. * Other minor maintenance changes. * Started separating out modular arithmetic. * Began refactoring ripple-carry comparators. * Refactored integer increment operations. * Fixed some See Also blocks. * Some minor progress. * Moved new arithmetic functionality into right folders. * Renamed integer arithmetic namespaces. * Split out qecc namespace. * Added documentation file for Microsoft.Quantum.ErrorCorrection. * Progress on renaming type conversion functions. * More progress on updating type conversion names. * Split out AA namespace. * Split out oracles namespace as well. * Renamed UDTs to remove "AmpAmp" prefix. This prefix is now implied by the Microsoft.Quantum.AmplitudeAmplification namespace. * Renamed some Qecc operations/fns * Moved more conversions into Convert.qs. * Updated some deprecated syntax. * Split out M.Q.Convert. * Added missing open stmt. * Started separating out classical math. * Began separating out QCVV. * Fixing namespaces in tests. * Update to use new docgen. * Began making arrays namespace. * Updated to use new arrays and diagnostics namespaces. * Updated names for claims * Started extracting measurements from Paulis.qs. * Updated namespaces in tests as well. * Updating chemistry for most recent changes. * Added ForEach, used to simplify measurements. * Updating deprecated Q# syntax. * Minor fix for XML error. * Fixed infinite recursion in deprecation stubs. * Started trying to reduce # of warnings. * Fixed some minor build errors. * Resolved a couple TODOs. * Removed BigEndian support. * Resolved warnings due to && and ||. * Update Standard/src/Arithmetic/Shorthand.qs Co-Authored-By: cgranade <cgranade@gmail.com> * Addressing feedback. * Claim → Fact * Moved MeasureInteger back to Microsoft.Quantum.Arithmetic. * Resolved more deprecated syntax. * Removed one more LE suffix. * Addressing feedback. * Cgranade/complete 0.6 move (#57) * Revert "Begin refactoring standard libraries (#39)" (#56) As Chris pointed out, reverting these breaking changes until we have a chance to change everything... * Complete move of standard library refactoring to release branch This reverts commit 058048983c4d0509e5d522888d3d47ae49cd300e. * Explicitly qualify all names in M.Q.Ext.Math. (#74) * Explicitly qualify all names in M.Q.Ext.Math. * Fixed two missing qualified names. * Removed more occurances of M.Q.Ext.Math. * Removed Microsoft.Quantum.Extensions.Math from tests as well. * Reverted slight change to QuantumROM. * New array functions (#75) * Added new IndexRange function to eliminate `-1` in for loops. * Added some missing open statements. * New Enumerated function. * Port library and test code to new 0.6 names to reduce warning count. (#72) * Updating to use new syntax, namespace names, etc. * More primitive → intrinsic. * Updated test project to use beta version. * Updated chemistry proiects to beta. * Finding a few more calls to deprecated fns. * Cleaned up some assert and qcvv tests. * Removed uses of deprecated IntArrayFromRange * Resolved some more deprecated functions and ops. * Minor maintenance in QubitizationTests. * Bumped versions to latest beta. * Some trivial change to retrigger build. * Resolved package downgrade. * Move Microsoft.Quantum.Math.Complex UDT and resolve Microsoft.Quantum.Diagnostics deprecation stubs. (#77) * More primitive → intrinsic. * Finding a few more calls to deprecated fns. * Resolved some more deprecated functions and ops. * Minor maintenance in QubitizationTests. * Bumped versions to latest beta. * Resolved package downgrade. * Use Complex UDT at its new name. * Adapted tests. * A few more test adaptations. * Updated name of AssertQubitState to 0.6 name. * Fixes to chemistry. * Getting updates from master (#80) * Revert "Begin refactoring standard libraries (#39)" (#56) As Chris pointed out, reverting these breaking changes until we have a chance to change everything... * Missing return statement when compiling more than one Q# snippet from Python. (#60) * Fixing bug * Adding tests * Change Assembly.Version to Python.Version. (#64) * Prevent loading Q# modules when Python client is busy. (#71) * Prevent loading Q# modules when Python client is busy. * Linux build failed with some unrelated problem. Committing. * modifying contructor calls for QArray in preparation for a simulation framework change (#78) * Revert "Revert "Begin refactoring standard libraries (#39)" (#56)" This reverts commit 058048983c4d0509e5d522888d3d47ae49cd300e. * Update to 0.6.1904.1302-beta. (#81) * Update to 0.6.1904.1302-beta. * Removed deprecation warnings for Microsoft.Quantum.Math. * Resolved a few more deprecations. * Resolved a few more deprecation warnings. * A few more deprecation resolutions. * Removed some duplicate namespace opens. * Slight code cleanup. * Addressed feedback from @bettinaheim. * Standard.sln builds again, Standard.sln builds (#84) * Gulow/v0.6 chemistry deprecation (#82) * Update to 0.6.1904.1302-beta. * Removed deprecation warnings for Microsoft.Quantum.Math. * Resolved a few more deprecations. * Resolved a few more deprecation warnings. * A few more deprecation resolutions. * Removed some duplicate namespace opens. * Slight code cleanup. * Update test * . * Remove deprecated operations from chemistry and dependencies. * Fix comments * Update to use 0.65 syntax from latest beta. (#87) * Ported stateprep.qs to 0.65 syntax. * Fixed deprecation in test. * Updated to latest beta. * Fix mutable array issue in chemistry data model. (#88) * Explicitly call new QArray. (#89) * do not rely on collections.immutable (#93) * Continue migrating libraries to Q# 0.6 (#91) * Continue migrating to 0.65 syntax and applying style guidance. * A bit more progress normalizing private names. * Resolved more deprecated syntax, updated a name. * Resolved some more syntax warnings. * Ported more syntax and updated more names. * Resolved all remaining compile-time warnings in Standard. * Addressed all Q#-level compile-time warnings in chem. * Migrated a bit more syntax and updated to newest beta. * Moved to using intrinsic warnings. * Fixed endianness of exact QFT. * Fixed Microsoft.Quantum.Warnings. * Addressing @bettinaheim's feedback. * Removed some warnings in unit tests. * Adding DocsOutDir for single doc output location across projects. (#94) * Adding DocsOutDir for single doc output location across projects. * Begin adding more classical math functions for BigInt. (#96) * Begin adding more classical math functions for BigInt. * Addressing @beheim's feedback. * Minor fixes. * Bump to latest beta. * Fixed two minor bugs. * Fixed the type of signs. * Bump version to released packages.
2019-05-04 01:44:41 +03:00
fail $"Expected (1, PauliY), got ({leftActual1}, {rightActual1}).";
}
2019-11-22 22:25:20 +03:00
Release v0.6 to master. (#98) * Begin refactoring standard libraries (#39) * Began splitting up namespaces. * Began refactoring tests. * Updated chemistry src and tests for new namespaces. * Remove unused opens. * Began renaming operations and functions. * Separated out and updated ApplyReversed*. * Updated BE ↔ LE type conversions. * Added new transformed operation fns. * Whitespace fix * Eliminated some redundant code in applyreversed * Fixed deprecation comments. * Began working on refactoring With. * Refactored With further. * More renaming for consistency with LE/BE suffix convention. * Added Zip3, Zip4 * Added shorthand for MAJ and updated some type conv. * Fixed a typo in Zip4. * Separated out and updated arithmetic measurements. * Other minor maintenance changes. * Started separating out modular arithmetic. * Began refactoring ripple-carry comparators. * Refactored integer increment operations. * Fixed some See Also blocks. * Some minor progress. * Moved new arithmetic functionality into right folders. * Renamed integer arithmetic namespaces. * Split out qecc namespace. * Added documentation file for Microsoft.Quantum.ErrorCorrection. * Progress on renaming type conversion functions. * More progress on updating type conversion names. * Split out AA namespace. * Split out oracles namespace as well. * Renamed UDTs to remove "AmpAmp" prefix. This prefix is now implied by the Microsoft.Quantum.AmplitudeAmplification namespace. * Renamed some Qecc operations/fns * Moved more conversions into Convert.qs. * Updated some deprecated syntax. * Split out M.Q.Convert. * Added missing open stmt. * Started separating out classical math. * Began separating out QCVV. * Fixing namespaces in tests. * Update to use new docgen. * Began making arrays namespace. * Updated to use new arrays and diagnostics namespaces. * Updated names for claims * Started extracting measurements from Paulis.qs. * Updated namespaces in tests as well. * Updating chemistry for most recent changes. * Added ForEach, used to simplify measurements. * Updating deprecated Q# syntax. * Minor fix for XML error. * Fixed infinite recursion in deprecation stubs. * Started trying to reduce # of warnings. * Fixed some minor build errors. * Resolved a couple TODOs. * Removed BigEndian support. * Resolved warnings due to && and ||. * Update Standard/src/Arithmetic/Shorthand.qs Co-Authored-By: cgranade <cgranade@gmail.com> * Addressing feedback. * Claim → Fact * Moved MeasureInteger back to Microsoft.Quantum.Arithmetic. * Resolved more deprecated syntax. * Removed one more LE suffix. * Addressing feedback. * Cgranade/complete 0.6 move (#57) * Revert "Begin refactoring standard libraries (#39)" (#56) As Chris pointed out, reverting these breaking changes until we have a chance to change everything... * Complete move of standard library refactoring to release branch This reverts commit 058048983c4d0509e5d522888d3d47ae49cd300e. * Explicitly qualify all names in M.Q.Ext.Math. (#74) * Explicitly qualify all names in M.Q.Ext.Math. * Fixed two missing qualified names. * Removed more occurances of M.Q.Ext.Math. * Removed Microsoft.Quantum.Extensions.Math from tests as well. * Reverted slight change to QuantumROM. * New array functions (#75) * Added new IndexRange function to eliminate `-1` in for loops. * Added some missing open statements. * New Enumerated function. * Port library and test code to new 0.6 names to reduce warning count. (#72) * Updating to use new syntax, namespace names, etc. * More primitive → intrinsic. * Updated test project to use beta version. * Updated chemistry proiects to beta. * Finding a few more calls to deprecated fns. * Cleaned up some assert and qcvv tests. * Removed uses of deprecated IntArrayFromRange * Resolved some more deprecated functions and ops. * Minor maintenance in QubitizationTests. * Bumped versions to latest beta. * Some trivial change to retrigger build. * Resolved package downgrade. * Move Microsoft.Quantum.Math.Complex UDT and resolve Microsoft.Quantum.Diagnostics deprecation stubs. (#77) * More primitive → intrinsic. * Finding a few more calls to deprecated fns. * Resolved some more deprecated functions and ops. * Minor maintenance in QubitizationTests. * Bumped versions to latest beta. * Resolved package downgrade. * Use Complex UDT at its new name. * Adapted tests. * A few more test adaptations. * Updated name of AssertQubitState to 0.6 name. * Fixes to chemistry. * Getting updates from master (#80) * Revert "Begin refactoring standard libraries (#39)" (#56) As Chris pointed out, reverting these breaking changes until we have a chance to change everything... * Missing return statement when compiling more than one Q# snippet from Python. (#60) * Fixing bug * Adding tests * Change Assembly.Version to Python.Version. (#64) * Prevent loading Q# modules when Python client is busy. (#71) * Prevent loading Q# modules when Python client is busy. * Linux build failed with some unrelated problem. Committing. * modifying contructor calls for QArray in preparation for a simulation framework change (#78) * Revert "Revert "Begin refactoring standard libraries (#39)" (#56)" This reverts commit 058048983c4d0509e5d522888d3d47ae49cd300e. * Update to 0.6.1904.1302-beta. (#81) * Update to 0.6.1904.1302-beta. * Removed deprecation warnings for Microsoft.Quantum.Math. * Resolved a few more deprecations. * Resolved a few more deprecation warnings. * A few more deprecation resolutions. * Removed some duplicate namespace opens. * Slight code cleanup. * Addressed feedback from @bettinaheim. * Standard.sln builds again, Standard.sln builds (#84) * Gulow/v0.6 chemistry deprecation (#82) * Update to 0.6.1904.1302-beta. * Removed deprecation warnings for Microsoft.Quantum.Math. * Resolved a few more deprecations. * Resolved a few more deprecation warnings. * A few more deprecation resolutions. * Removed some duplicate namespace opens. * Slight code cleanup. * Update test * . * Remove deprecated operations from chemistry and dependencies. * Fix comments * Update to use 0.65 syntax from latest beta. (#87) * Ported stateprep.qs to 0.65 syntax. * Fixed deprecation in test. * Updated to latest beta. * Fix mutable array issue in chemistry data model. (#88) * Explicitly call new QArray. (#89) * do not rely on collections.immutable (#93) * Continue migrating libraries to Q# 0.6 (#91) * Continue migrating to 0.65 syntax and applying style guidance. * A bit more progress normalizing private names. * Resolved more deprecated syntax, updated a name. * Resolved some more syntax warnings. * Ported more syntax and updated more names. * Resolved all remaining compile-time warnings in Standard. * Addressed all Q#-level compile-time warnings in chem. * Migrated a bit more syntax and updated to newest beta. * Moved to using intrinsic warnings. * Fixed endianness of exact QFT. * Fixed Microsoft.Quantum.Warnings. * Addressing @bettinaheim's feedback. * Removed some warnings in unit tests. * Adding DocsOutDir for single doc output location across projects. (#94) * Adding DocsOutDir for single doc output location across projects. * Begin adding more classical math functions for BigInt. (#96) * Begin adding more classical math functions for BigInt. * Addressing @beheim's feedback. * Minor fixes. * Bump to latest beta. * Fixed two minor bugs. * Fixed the type of signs. * Bump version to released packages.
2019-05-04 01:44:41 +03:00
let (leftActual2, rightActual2) = zipped[1];
2019-11-22 22:25:20 +03:00
if leftActual2 != 2 or rightActual2 != PauliI {
Release v0.6 to master. (#98) * Begin refactoring standard libraries (#39) * Began splitting up namespaces. * Began refactoring tests. * Updated chemistry src and tests for new namespaces. * Remove unused opens. * Began renaming operations and functions. * Separated out and updated ApplyReversed*. * Updated BE ↔ LE type conversions. * Added new transformed operation fns. * Whitespace fix * Eliminated some redundant code in applyreversed * Fixed deprecation comments. * Began working on refactoring With. * Refactored With further. * More renaming for consistency with LE/BE suffix convention. * Added Zip3, Zip4 * Added shorthand for MAJ and updated some type conv. * Fixed a typo in Zip4. * Separated out and updated arithmetic measurements. * Other minor maintenance changes. * Started separating out modular arithmetic. * Began refactoring ripple-carry comparators. * Refactored integer increment operations. * Fixed some See Also blocks. * Some minor progress. * Moved new arithmetic functionality into right folders. * Renamed integer arithmetic namespaces. * Split out qecc namespace. * Added documentation file for Microsoft.Quantum.ErrorCorrection. * Progress on renaming type conversion functions. * More progress on updating type conversion names. * Split out AA namespace. * Split out oracles namespace as well. * Renamed UDTs to remove "AmpAmp" prefix. This prefix is now implied by the Microsoft.Quantum.AmplitudeAmplification namespace. * Renamed some Qecc operations/fns * Moved more conversions into Convert.qs. * Updated some deprecated syntax. * Split out M.Q.Convert. * Added missing open stmt. * Started separating out classical math. * Began separating out QCVV. * Fixing namespaces in tests. * Update to use new docgen. * Began making arrays namespace. * Updated to use new arrays and diagnostics namespaces. * Updated names for claims * Started extracting measurements from Paulis.qs. * Updated namespaces in tests as well. * Updating chemistry for most recent changes. * Added ForEach, used to simplify measurements. * Updating deprecated Q# syntax. * Minor fix for XML error. * Fixed infinite recursion in deprecation stubs. * Started trying to reduce # of warnings. * Fixed some minor build errors. * Resolved a couple TODOs. * Removed BigEndian support. * Resolved warnings due to && and ||. * Update Standard/src/Arithmetic/Shorthand.qs Co-Authored-By: cgranade <cgranade@gmail.com> * Addressing feedback. * Claim → Fact * Moved MeasureInteger back to Microsoft.Quantum.Arithmetic. * Resolved more deprecated syntax. * Removed one more LE suffix. * Addressing feedback. * Cgranade/complete 0.6 move (#57) * Revert "Begin refactoring standard libraries (#39)" (#56) As Chris pointed out, reverting these breaking changes until we have a chance to change everything... * Complete move of standard library refactoring to release branch This reverts commit 058048983c4d0509e5d522888d3d47ae49cd300e. * Explicitly qualify all names in M.Q.Ext.Math. (#74) * Explicitly qualify all names in M.Q.Ext.Math. * Fixed two missing qualified names. * Removed more occurances of M.Q.Ext.Math. * Removed Microsoft.Quantum.Extensions.Math from tests as well. * Reverted slight change to QuantumROM. * New array functions (#75) * Added new IndexRange function to eliminate `-1` in for loops. * Added some missing open statements. * New Enumerated function. * Port library and test code to new 0.6 names to reduce warning count. (#72) * Updating to use new syntax, namespace names, etc. * More primitive → intrinsic. * Updated test project to use beta version. * Updated chemistry proiects to beta. * Finding a few more calls to deprecated fns. * Cleaned up some assert and qcvv tests. * Removed uses of deprecated IntArrayFromRange * Resolved some more deprecated functions and ops. * Minor maintenance in QubitizationTests. * Bumped versions to latest beta. * Some trivial change to retrigger build. * Resolved package downgrade. * Move Microsoft.Quantum.Math.Complex UDT and resolve Microsoft.Quantum.Diagnostics deprecation stubs. (#77) * More primitive → intrinsic. * Finding a few more calls to deprecated fns. * Resolved some more deprecated functions and ops. * Minor maintenance in QubitizationTests. * Bumped versions to latest beta. * Resolved package downgrade. * Use Complex UDT at its new name. * Adapted tests. * A few more test adaptations. * Updated name of AssertQubitState to 0.6 name. * Fixes to chemistry. * Getting updates from master (#80) * Revert "Begin refactoring standard libraries (#39)" (#56) As Chris pointed out, reverting these breaking changes until we have a chance to change everything... * Missing return statement when compiling more than one Q# snippet from Python. (#60) * Fixing bug * Adding tests * Change Assembly.Version to Python.Version. (#64) * Prevent loading Q# modules when Python client is busy. (#71) * Prevent loading Q# modules when Python client is busy. * Linux build failed with some unrelated problem. Committing. * modifying contructor calls for QArray in preparation for a simulation framework change (#78) * Revert "Revert "Begin refactoring standard libraries (#39)" (#56)" This reverts commit 058048983c4d0509e5d522888d3d47ae49cd300e. * Update to 0.6.1904.1302-beta. (#81) * Update to 0.6.1904.1302-beta. * Removed deprecation warnings for Microsoft.Quantum.Math. * Resolved a few more deprecations. * Resolved a few more deprecation warnings. * A few more deprecation resolutions. * Removed some duplicate namespace opens. * Slight code cleanup. * Addressed feedback from @bettinaheim. * Standard.sln builds again, Standard.sln builds (#84) * Gulow/v0.6 chemistry deprecation (#82) * Update to 0.6.1904.1302-beta. * Removed deprecation warnings for Microsoft.Quantum.Math. * Resolved a few more deprecations. * Resolved a few more deprecation warnings. * A few more deprecation resolutions. * Removed some duplicate namespace opens. * Slight code cleanup. * Update test * . * Remove deprecated operations from chemistry and dependencies. * Fix comments * Update to use 0.65 syntax from latest beta. (#87) * Ported stateprep.qs to 0.65 syntax. * Fixed deprecation in test. * Updated to latest beta. * Fix mutable array issue in chemistry data model. (#88) * Explicitly call new QArray. (#89) * do not rely on collections.immutable (#93) * Continue migrating libraries to Q# 0.6 (#91) * Continue migrating to 0.65 syntax and applying style guidance. * A bit more progress normalizing private names. * Resolved more deprecated syntax, updated a name. * Resolved some more syntax warnings. * Ported more syntax and updated more names. * Resolved all remaining compile-time warnings in Standard. * Addressed all Q#-level compile-time warnings in chem. * Migrated a bit more syntax and updated to newest beta. * Moved to using intrinsic warnings. * Fixed endianness of exact QFT. * Fixed Microsoft.Quantum.Warnings. * Addressing @bettinaheim's feedback. * Removed some warnings in unit tests. * Adding DocsOutDir for single doc output location across projects. (#94) * Adding DocsOutDir for single doc output location across projects. * Begin adding more classical math functions for BigInt. (#96) * Begin adding more classical math functions for BigInt. * Addressing @beheim's feedback. * Minor fixes. * Bump to latest beta. * Fixed two minor bugs. * Fixed the type of signs. * Bump version to released packages.
2019-05-04 01:44:41 +03:00
fail $"Expected (2, PauliI), got ({leftActual2}, {rightActual2}).";
}
}
2019-11-22 22:25:20 +03:00
@Test("QuantumSimulator")
Feature/state preparation (#376) * 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 984156791d29db5190698ba0b17d3e4733c7f9af Author: Mathias Soeken <masoeken@microsoft.com> Date: Mon Aug 31 10:41:17 2020 +0200 Fix bug in QuantumROM. commit 9726ff259748c5e04c2ce39754bb48697fd2ea4e Merge: 58d428ed 0b02a6a5 Author: Mathias Soeken <masoeken@microsoft.com> Date: Mon Aug 31 09:49:43 2020 +0200 Merge branch 'master' into msoeken/state-preparation-cleanup commit 58d428ed6476d096fe5678dbc04f6e95b19e0d1f Author: Mathias Soeken <masoeken@microsoft.com> Date: Thu Aug 27 11:59:12 2020 +0200 Cleanup remaining files. commit b35222ab855c85c8bab699b0a489af089f811d12 Author: Mathias Soeken <masoeken@microsoft.com> Date: Thu Aug 27 11:54:33 2020 +0200 Clean-up arbitrary state preparation. commit e8076f770f3fe4fdba7c17cd176443abcd9aac98 Author: Mathias Soeken <masoeken@microsoft.com> Date: Wed Aug 26 09:31:17 2020 +0200 Cleanup quantum ROM. commit 860c0ab12a0fac8a1d053bd6118897761bc547fa Author: Mathias Soeken <masoeken@microsoft.com> Date: Wed Aug 26 09:21:21 2020 +0200 Cleanup uniform superposition. commit b94ec8c2dcc26b9afe763e2961218b15a1e7cac3 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 cb77faa3854d3c3b7b32938585ddb4596d8d84c2 Author: Mathias Soeken <masoeken@microsoft.com> Date: Mon Aug 31 16:46:12 2020 +0200 Fix error. commit 984156791d29db5190698ba0b17d3e4733c7f9af Author: Mathias Soeken <masoeken@microsoft.com> Date: Mon Aug 31 10:41:17 2020 +0200 Fix bug in QuantumROM. commit 9726ff259748c5e04c2ce39754bb48697fd2ea4e Merge: 58d428ed 0b02a6a5 Author: Mathias Soeken <masoeken@microsoft.com> Date: Mon Aug 31 09:49:43 2020 +0200 Merge branch 'master' into msoeken/state-preparation-cleanup commit 58d428ed6476d096fe5678dbc04f6e95b19e0d1f Author: Mathias Soeken <masoeken@microsoft.com> Date: Thu Aug 27 11:59:12 2020 +0200 Cleanup remaining files. commit b35222ab855c85c8bab699b0a489af089f811d12 Author: Mathias Soeken <masoeken@microsoft.com> Date: Thu Aug 27 11:54:33 2020 +0200 Clean-up arbitrary state preparation. commit e8076f770f3fe4fdba7c17cd176443abcd9aac98 Author: Mathias Soeken <masoeken@microsoft.com> Date: Wed Aug 26 09:31:17 2020 +0200 Cleanup quantum ROM. commit 860c0ab12a0fac8a1d053bd6118897761bc547fa Author: Mathias Soeken <masoeken@microsoft.com> Date: Wed Aug 26 09:21:21 2020 +0200 Cleanup uniform superposition. commit b94ec8c2dcc26b9afe763e2961218b15a1e7cac3 Author: Mathias Soeken <masoeken@microsoft.com> Date: Tue Aug 25 15:56:26 2020 +0200 Cleanup QuantumROM. * Squashed commit of the following: commit cde7c0cdad4c6b1c9b84906587de575ae206450f 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>
2020-11-19 00:13:01 +03:00
function UnzippedTest() : Unit {
let first = [6, 5, 5, 3, 2, 1];
let second = [true, false, false, false, true, false];
let (first2, second2) = Unzipped(Zipped(first, second));
AllEqualityFactI(first2, first, "Unexpected array of integers");
AllEqualityFactB(second2, second, "Unexpected array of Booleans");
}
2019-11-22 22:25:20 +03:00
@Test("QuantumSimulator")
function TestLookup() : Unit {
2019-11-22 22:25:20 +03:00
Release v0.6 to master. (#98) * Begin refactoring standard libraries (#39) * Began splitting up namespaces. * Began refactoring tests. * Updated chemistry src and tests for new namespaces. * Remove unused opens. * Began renaming operations and functions. * Separated out and updated ApplyReversed*. * Updated BE ↔ LE type conversions. * Added new transformed operation fns. * Whitespace fix * Eliminated some redundant code in applyreversed * Fixed deprecation comments. * Began working on refactoring With. * Refactored With further. * More renaming for consistency with LE/BE suffix convention. * Added Zip3, Zip4 * Added shorthand for MAJ and updated some type conv. * Fixed a typo in Zip4. * Separated out and updated arithmetic measurements. * Other minor maintenance changes. * Started separating out modular arithmetic. * Began refactoring ripple-carry comparators. * Refactored integer increment operations. * Fixed some See Also blocks. * Some minor progress. * Moved new arithmetic functionality into right folders. * Renamed integer arithmetic namespaces. * Split out qecc namespace. * Added documentation file for Microsoft.Quantum.ErrorCorrection. * Progress on renaming type conversion functions. * More progress on updating type conversion names. * Split out AA namespace. * Split out oracles namespace as well. * Renamed UDTs to remove "AmpAmp" prefix. This prefix is now implied by the Microsoft.Quantum.AmplitudeAmplification namespace. * Renamed some Qecc operations/fns * Moved more conversions into Convert.qs. * Updated some deprecated syntax. * Split out M.Q.Convert. * Added missing open stmt. * Started separating out classical math. * Began separating out QCVV. * Fixing namespaces in tests. * Update to use new docgen. * Began making arrays namespace. * Updated to use new arrays and diagnostics namespaces. * Updated names for claims * Started extracting measurements from Paulis.qs. * Updated namespaces in tests as well. * Updating chemistry for most recent changes. * Added ForEach, used to simplify measurements. * Updating deprecated Q# syntax. * Minor fix for XML error. * Fixed infinite recursion in deprecation stubs. * Started trying to reduce # of warnings. * Fixed some minor build errors. * Resolved a couple TODOs. * Removed BigEndian support. * Resolved warnings due to && and ||. * Update Standard/src/Arithmetic/Shorthand.qs Co-Authored-By: cgranade <cgranade@gmail.com> * Addressing feedback. * Claim → Fact * Moved MeasureInteger back to Microsoft.Quantum.Arithmetic. * Resolved more deprecated syntax. * Removed one more LE suffix. * Addressing feedback. * Cgranade/complete 0.6 move (#57) * Revert "Begin refactoring standard libraries (#39)" (#56) As Chris pointed out, reverting these breaking changes until we have a chance to change everything... * Complete move of standard library refactoring to release branch This reverts commit 058048983c4d0509e5d522888d3d47ae49cd300e. * Explicitly qualify all names in M.Q.Ext.Math. (#74) * Explicitly qualify all names in M.Q.Ext.Math. * Fixed two missing qualified names. * Removed more occurances of M.Q.Ext.Math. * Removed Microsoft.Quantum.Extensions.Math from tests as well. * Reverted slight change to QuantumROM. * New array functions (#75) * Added new IndexRange function to eliminate `-1` in for loops. * Added some missing open statements. * New Enumerated function. * Port library and test code to new 0.6 names to reduce warning count. (#72) * Updating to use new syntax, namespace names, etc. * More primitive → intrinsic. * Updated test project to use beta version. * Updated chemistry proiects to beta. * Finding a few more calls to deprecated fns. * Cleaned up some assert and qcvv tests. * Removed uses of deprecated IntArrayFromRange * Resolved some more deprecated functions and ops. * Minor maintenance in QubitizationTests. * Bumped versions to latest beta. * Some trivial change to retrigger build. * Resolved package downgrade. * Move Microsoft.Quantum.Math.Complex UDT and resolve Microsoft.Quantum.Diagnostics deprecation stubs. (#77) * More primitive → intrinsic. * Finding a few more calls to deprecated fns. * Resolved some more deprecated functions and ops. * Minor maintenance in QubitizationTests. * Bumped versions to latest beta. * Resolved package downgrade. * Use Complex UDT at its new name. * Adapted tests. * A few more test adaptations. * Updated name of AssertQubitState to 0.6 name. * Fixes to chemistry. * Getting updates from master (#80) * Revert "Begin refactoring standard libraries (#39)" (#56) As Chris pointed out, reverting these breaking changes until we have a chance to change everything... * Missing return statement when compiling more than one Q# snippet from Python. (#60) * Fixing bug * Adding tests * Change Assembly.Version to Python.Version. (#64) * Prevent loading Q# modules when Python client is busy. (#71) * Prevent loading Q# modules when Python client is busy. * Linux build failed with some unrelated problem. Committing. * modifying contructor calls for QArray in preparation for a simulation framework change (#78) * Revert "Revert "Begin refactoring standard libraries (#39)" (#56)" This reverts commit 058048983c4d0509e5d522888d3d47ae49cd300e. * Update to 0.6.1904.1302-beta. (#81) * Update to 0.6.1904.1302-beta. * Removed deprecation warnings for Microsoft.Quantum.Math. * Resolved a few more deprecations. * Resolved a few more deprecation warnings. * A few more deprecation resolutions. * Removed some duplicate namespace opens. * Slight code cleanup. * Addressed feedback from @bettinaheim. * Standard.sln builds again, Standard.sln builds (#84) * Gulow/v0.6 chemistry deprecation (#82) * Update to 0.6.1904.1302-beta. * Removed deprecation warnings for Microsoft.Quantum.Math. * Resolved a few more deprecations. * Resolved a few more deprecation warnings. * A few more deprecation resolutions. * Removed some duplicate namespace opens. * Slight code cleanup. * Update test * . * Remove deprecated operations from chemistry and dependencies. * Fix comments * Update to use 0.65 syntax from latest beta. (#87) * Ported stateprep.qs to 0.65 syntax. * Fixed deprecation in test. * Updated to latest beta. * Fix mutable array issue in chemistry data model. (#88) * Explicitly call new QArray. (#89) * do not rely on collections.immutable (#93) * Continue migrating libraries to Q# 0.6 (#91) * Continue migrating to 0.65 syntax and applying style guidance. * A bit more progress normalizing private names. * Resolved more deprecated syntax, updated a name. * Resolved some more syntax warnings. * Ported more syntax and updated more names. * Resolved all remaining compile-time warnings in Standard. * Addressed all Q#-level compile-time warnings in chem. * Migrated a bit more syntax and updated to newest beta. * Moved to using intrinsic warnings. * Fixed endianness of exact QFT. * Fixed Microsoft.Quantum.Warnings. * Addressing @bettinaheim's feedback. * Removed some warnings in unit tests. * Adding DocsOutDir for single doc output location across projects. (#94) * Adding DocsOutDir for single doc output location across projects. * Begin adding more classical math functions for BigInt. (#96) * Begin adding more classical math functions for BigInt. * Addressing @beheim's feedback. * Minor fixes. * Bump to latest beta. * Fixed two minor bugs. * Fixed the type of signs. * Bump version to released packages.
2019-05-04 01:44:41 +03:00
let array = [1, 12, 71, 103];
let fn = LookupFunction(array);
EqualityFactI(fn(0), 1, $"fn(0) did not return array[0]");
2019-11-22 22:25:20 +03:00
Release v0.6 to master. (#98) * Begin refactoring standard libraries (#39) * Began splitting up namespaces. * Began refactoring tests. * Updated chemistry src and tests for new namespaces. * Remove unused opens. * Began renaming operations and functions. * Separated out and updated ApplyReversed*. * Updated BE ↔ LE type conversions. * Added new transformed operation fns. * Whitespace fix * Eliminated some redundant code in applyreversed * Fixed deprecation comments. * Began working on refactoring With. * Refactored With further. * More renaming for consistency with LE/BE suffix convention. * Added Zip3, Zip4 * Added shorthand for MAJ and updated some type conv. * Fixed a typo in Zip4. * Separated out and updated arithmetic measurements. * Other minor maintenance changes. * Started separating out modular arithmetic. * Began refactoring ripple-carry comparators. * Refactored integer increment operations. * Fixed some See Also blocks. * Some minor progress. * Moved new arithmetic functionality into right folders. * Renamed integer arithmetic namespaces. * Split out qecc namespace. * Added documentation file for Microsoft.Quantum.ErrorCorrection. * Progress on renaming type conversion functions. * More progress on updating type conversion names. * Split out AA namespace. * Split out oracles namespace as well. * Renamed UDTs to remove "AmpAmp" prefix. This prefix is now implied by the Microsoft.Quantum.AmplitudeAmplification namespace. * Renamed some Qecc operations/fns * Moved more conversions into Convert.qs. * Updated some deprecated syntax. * Split out M.Q.Convert. * Added missing open stmt. * Started separating out classical math. * Began separating out QCVV. * Fixing namespaces in tests. * Update to use new docgen. * Began making arrays namespace. * Updated to use new arrays and diagnostics namespaces. * Updated names for claims * Started extracting measurements from Paulis.qs. * Updated namespaces in tests as well. * Updating chemistry for most recent changes. * Added ForEach, used to simplify measurements. * Updating deprecated Q# syntax. * Minor fix for XML error. * Fixed infinite recursion in deprecation stubs. * Started trying to reduce # of warnings. * Fixed some minor build errors. * Resolved a couple TODOs. * Removed BigEndian support. * Resolved warnings due to && and ||. * Update Standard/src/Arithmetic/Shorthand.qs Co-Authored-By: cgranade <cgranade@gmail.com> * Addressing feedback. * Claim → Fact * Moved MeasureInteger back to Microsoft.Quantum.Arithmetic. * Resolved more deprecated syntax. * Removed one more LE suffix. * Addressing feedback. * Cgranade/complete 0.6 move (#57) * Revert "Begin refactoring standard libraries (#39)" (#56) As Chris pointed out, reverting these breaking changes until we have a chance to change everything... * Complete move of standard library refactoring to release branch This reverts commit 058048983c4d0509e5d522888d3d47ae49cd300e. * Explicitly qualify all names in M.Q.Ext.Math. (#74) * Explicitly qualify all names in M.Q.Ext.Math. * Fixed two missing qualified names. * Removed more occurances of M.Q.Ext.Math. * Removed Microsoft.Quantum.Extensions.Math from tests as well. * Reverted slight change to QuantumROM. * New array functions (#75) * Added new IndexRange function to eliminate `-1` in for loops. * Added some missing open statements. * New Enumerated function. * Port library and test code to new 0.6 names to reduce warning count. (#72) * Updating to use new syntax, namespace names, etc. * More primitive → intrinsic. * Updated test project to use beta version. * Updated chemistry proiects to beta. * Finding a few more calls to deprecated fns. * Cleaned up some assert and qcvv tests. * Removed uses of deprecated IntArrayFromRange * Resolved some more deprecated functions and ops. * Minor maintenance in QubitizationTests. * Bumped versions to latest beta. * Some trivial change to retrigger build. * Resolved package downgrade. * Move Microsoft.Quantum.Math.Complex UDT and resolve Microsoft.Quantum.Diagnostics deprecation stubs. (#77) * More primitive → intrinsic. * Finding a few more calls to deprecated fns. * Resolved some more deprecated functions and ops. * Minor maintenance in QubitizationTests. * Bumped versions to latest beta. * Resolved package downgrade. * Use Complex UDT at its new name. * Adapted tests. * A few more test adaptations. * Updated name of AssertQubitState to 0.6 name. * Fixes to chemistry. * Getting updates from master (#80) * Revert "Begin refactoring standard libraries (#39)" (#56) As Chris pointed out, reverting these breaking changes until we have a chance to change everything... * Missing return statement when compiling more than one Q# snippet from Python. (#60) * Fixing bug * Adding tests * Change Assembly.Version to Python.Version. (#64) * Prevent loading Q# modules when Python client is busy. (#71) * Prevent loading Q# modules when Python client is busy. * Linux build failed with some unrelated problem. Committing. * modifying contructor calls for QArray in preparation for a simulation framework change (#78) * Revert "Revert "Begin refactoring standard libraries (#39)" (#56)" This reverts commit 058048983c4d0509e5d522888d3d47ae49cd300e. * Update to 0.6.1904.1302-beta. (#81) * Update to 0.6.1904.1302-beta. * Removed deprecation warnings for Microsoft.Quantum.Math. * Resolved a few more deprecations. * Resolved a few more deprecation warnings. * A few more deprecation resolutions. * Removed some duplicate namespace opens. * Slight code cleanup. * Addressed feedback from @bettinaheim. * Standard.sln builds again, Standard.sln builds (#84) * Gulow/v0.6 chemistry deprecation (#82) * Update to 0.6.1904.1302-beta. * Removed deprecation warnings for Microsoft.Quantum.Math. * Resolved a few more deprecations. * Resolved a few more deprecation warnings. * A few more deprecation resolutions. * Removed some duplicate namespace opens. * Slight code cleanup. * Update test * . * Remove deprecated operations from chemistry and dependencies. * Fix comments * Update to use 0.65 syntax from latest beta. (#87) * Ported stateprep.qs to 0.65 syntax. * Fixed deprecation in test. * Updated to latest beta. * Fix mutable array issue in chemistry data model. (#88) * Explicitly call new QArray. (#89) * do not rely on collections.immutable (#93) * Continue migrating libraries to Q# 0.6 (#91) * Continue migrating to 0.65 syntax and applying style guidance. * A bit more progress normalizing private names. * Resolved more deprecated syntax, updated a name. * Resolved some more syntax warnings. * Ported more syntax and updated more names. * Resolved all remaining compile-time warnings in Standard. * Addressed all Q#-level compile-time warnings in chem. * Migrated a bit more syntax and updated to newest beta. * Moved to using intrinsic warnings. * Fixed endianness of exact QFT. * Fixed Microsoft.Quantum.Warnings. * Addressing @bettinaheim's feedback. * Removed some warnings in unit tests. * Adding DocsOutDir for single doc output location across projects. (#94) * Adding DocsOutDir for single doc output location across projects. * Begin adding more classical math functions for BigInt. (#96) * Begin adding more classical math functions for BigInt. * Addressing @beheim's feedback. * Minor fixes. * Bump to latest beta. * Fixed two minor bugs. * Fixed the type of signs. * Bump version to released packages.
2019-05-04 01:44:41 +03:00
// Make sure we can call in random order!
EqualityFactI(fn(3), 103, $"fn(3) did not return array[3]");
EqualityFactI(fn(2), 71, $"fn(2) did not return array[2]");
EqualityFactI(fn(1), 12, $"fn(1) did not return array[1]");
}
2019-11-22 22:25:20 +03:00
internal function AllEqualI(expected : Int[], actual : Int[]) : Bool {
return All(EqualI, Zipped(expected, actual));
}
@Test("QuantumSimulator")
function TestChunks() : Unit {
let data = [10, 11, 12, 13, 14, 15];
// 2 × 3 case.
Fact(All(AllEqualI, Zipped(
[[10, 11], [12, 13], [14, 15]],
Chunks(2, data)
)), "Wrong chunks in 2x3 case.");
// Case with some leftovers.
Fact(All(AllEqualI, Zipped(
[[10, 11, 12, 13], [14, 15]],
Chunks(4, data)
)), "Wrong chunks in case with leftover elements.");
}
2019-11-22 22:25:20 +03:00
internal function Squared(x : Int) : Int {
Release v0.6 to master. (#98) * Begin refactoring standard libraries (#39) * Began splitting up namespaces. * Began refactoring tests. * Updated chemistry src and tests for new namespaces. * Remove unused opens. * Began renaming operations and functions. * Separated out and updated ApplyReversed*. * Updated BE ↔ LE type conversions. * Added new transformed operation fns. * Whitespace fix * Eliminated some redundant code in applyreversed * Fixed deprecation comments. * Began working on refactoring With. * Refactored With further. * More renaming for consistency with LE/BE suffix convention. * Added Zip3, Zip4 * Added shorthand for MAJ and updated some type conv. * Fixed a typo in Zip4. * Separated out and updated arithmetic measurements. * Other minor maintenance changes. * Started separating out modular arithmetic. * Began refactoring ripple-carry comparators. * Refactored integer increment operations. * Fixed some See Also blocks. * Some minor progress. * Moved new arithmetic functionality into right folders. * Renamed integer arithmetic namespaces. * Split out qecc namespace. * Added documentation file for Microsoft.Quantum.ErrorCorrection. * Progress on renaming type conversion functions. * More progress on updating type conversion names. * Split out AA namespace. * Split out oracles namespace as well. * Renamed UDTs to remove "AmpAmp" prefix. This prefix is now implied by the Microsoft.Quantum.AmplitudeAmplification namespace. * Renamed some Qecc operations/fns * Moved more conversions into Convert.qs. * Updated some deprecated syntax. * Split out M.Q.Convert. * Added missing open stmt. * Started separating out classical math. * Began separating out QCVV. * Fixing namespaces in tests. * Update to use new docgen. * Began making arrays namespace. * Updated to use new arrays and diagnostics namespaces. * Updated names for claims * Started extracting measurements from Paulis.qs. * Updated namespaces in tests as well. * Updating chemistry for most recent changes. * Added ForEach, used to simplify measurements. * Updating deprecated Q# syntax. * Minor fix for XML error. * Fixed infinite recursion in deprecation stubs. * Started trying to reduce # of warnings. * Fixed some minor build errors. * Resolved a couple TODOs. * Removed BigEndian support. * Resolved warnings due to && and ||. * Update Standard/src/Arithmetic/Shorthand.qs Co-Authored-By: cgranade <cgranade@gmail.com> * Addressing feedback. * Claim → Fact * Moved MeasureInteger back to Microsoft.Quantum.Arithmetic. * Resolved more deprecated syntax. * Removed one more LE suffix. * Addressing feedback. * Cgranade/complete 0.6 move (#57) * Revert "Begin refactoring standard libraries (#39)" (#56) As Chris pointed out, reverting these breaking changes until we have a chance to change everything... * Complete move of standard library refactoring to release branch This reverts commit 058048983c4d0509e5d522888d3d47ae49cd300e. * Explicitly qualify all names in M.Q.Ext.Math. (#74) * Explicitly qualify all names in M.Q.Ext.Math. * Fixed two missing qualified names. * Removed more occurances of M.Q.Ext.Math. * Removed Microsoft.Quantum.Extensions.Math from tests as well. * Reverted slight change to QuantumROM. * New array functions (#75) * Added new IndexRange function to eliminate `-1` in for loops. * Added some missing open statements. * New Enumerated function. * Port library and test code to new 0.6 names to reduce warning count. (#72) * Updating to use new syntax, namespace names, etc. * More primitive → intrinsic. * Updated test project to use beta version. * Updated chemistry proiects to beta. * Finding a few more calls to deprecated fns. * Cleaned up some assert and qcvv tests. * Removed uses of deprecated IntArrayFromRange * Resolved some more deprecated functions and ops. * Minor maintenance in QubitizationTests. * Bumped versions to latest beta. * Some trivial change to retrigger build. * Resolved package downgrade. * Move Microsoft.Quantum.Math.Complex UDT and resolve Microsoft.Quantum.Diagnostics deprecation stubs. (#77) * More primitive → intrinsic. * Finding a few more calls to deprecated fns. * Resolved some more deprecated functions and ops. * Minor maintenance in QubitizationTests. * Bumped versions to latest beta. * Resolved package downgrade. * Use Complex UDT at its new name. * Adapted tests. * A few more test adaptations. * Updated name of AssertQubitState to 0.6 name. * Fixes to chemistry. * Getting updates from master (#80) * Revert "Begin refactoring standard libraries (#39)" (#56) As Chris pointed out, reverting these breaking changes until we have a chance to change everything... * Missing return statement when compiling more than one Q# snippet from Python. (#60) * Fixing bug * Adding tests * Change Assembly.Version to Python.Version. (#64) * Prevent loading Q# modules when Python client is busy. (#71) * Prevent loading Q# modules when Python client is busy. * Linux build failed with some unrelated problem. Committing. * modifying contructor calls for QArray in preparation for a simulation framework change (#78) * Revert "Revert "Begin refactoring standard libraries (#39)" (#56)" This reverts commit 058048983c4d0509e5d522888d3d47ae49cd300e. * Update to 0.6.1904.1302-beta. (#81) * Update to 0.6.1904.1302-beta. * Removed deprecation warnings for Microsoft.Quantum.Math. * Resolved a few more deprecations. * Resolved a few more deprecation warnings. * A few more deprecation resolutions. * Removed some duplicate namespace opens. * Slight code cleanup. * Addressed feedback from @bettinaheim. * Standard.sln builds again, Standard.sln builds (#84) * Gulow/v0.6 chemistry deprecation (#82) * Update to 0.6.1904.1302-beta. * Removed deprecation warnings for Microsoft.Quantum.Math. * Resolved a few more deprecations. * Resolved a few more deprecation warnings. * A few more deprecation resolutions. * Removed some duplicate namespace opens. * Slight code cleanup. * Update test * . * Remove deprecated operations from chemistry and dependencies. * Fix comments * Update to use 0.65 syntax from latest beta. (#87) * Ported stateprep.qs to 0.65 syntax. * Fixed deprecation in test. * Updated to latest beta. * Fix mutable array issue in chemistry data model. (#88) * Explicitly call new QArray. (#89) * do not rely on collections.immutable (#93) * Continue migrating libraries to Q# 0.6 (#91) * Continue migrating to 0.65 syntax and applying style guidance. * A bit more progress normalizing private names. * Resolved more deprecated syntax, updated a name. * Resolved some more syntax warnings. * Ported more syntax and updated more names. * Resolved all remaining compile-time warnings in Standard. * Addressed all Q#-level compile-time warnings in chem. * Migrated a bit more syntax and updated to newest beta. * Moved to using intrinsic warnings. * Fixed endianness of exact QFT. * Fixed Microsoft.Quantum.Warnings. * Addressing @bettinaheim's feedback. * Removed some warnings in unit tests. * Adding DocsOutDir for single doc output location across projects. (#94) * Adding DocsOutDir for single doc output location across projects. * Begin adding more classical math functions for BigInt. (#96) * Begin adding more classical math functions for BigInt. * Addressing @beheim's feedback. * Minor fixes. * Bump to latest beta. * Fixed two minor bugs. * Fixed the type of signs. * Bump version to released packages.
2019-05-04 01:44:41 +03:00
return x * x;
}
2019-11-22 22:25:20 +03:00
@Test("QuantumSimulator")
function ConstantArrayOfDoublesIsCorrect() : Unit {
Release v0.6 to master. (#98) * Begin refactoring standard libraries (#39) * Began splitting up namespaces. * Began refactoring tests. * Updated chemistry src and tests for new namespaces. * Remove unused opens. * Began renaming operations and functions. * Separated out and updated ApplyReversed*. * Updated BE ↔ LE type conversions. * Added new transformed operation fns. * Whitespace fix * Eliminated some redundant code in applyreversed * Fixed deprecation comments. * Began working on refactoring With. * Refactored With further. * More renaming for consistency with LE/BE suffix convention. * Added Zip3, Zip4 * Added shorthand for MAJ and updated some type conv. * Fixed a typo in Zip4. * Separated out and updated arithmetic measurements. * Other minor maintenance changes. * Started separating out modular arithmetic. * Began refactoring ripple-carry comparators. * Refactored integer increment operations. * Fixed some See Also blocks. * Some minor progress. * Moved new arithmetic functionality into right folders. * Renamed integer arithmetic namespaces. * Split out qecc namespace. * Added documentation file for Microsoft.Quantum.ErrorCorrection. * Progress on renaming type conversion functions. * More progress on updating type conversion names. * Split out AA namespace. * Split out oracles namespace as well. * Renamed UDTs to remove "AmpAmp" prefix. This prefix is now implied by the Microsoft.Quantum.AmplitudeAmplification namespace. * Renamed some Qecc operations/fns * Moved more conversions into Convert.qs. * Updated some deprecated syntax. * Split out M.Q.Convert. * Added missing open stmt. * Started separating out classical math. * Began separating out QCVV. * Fixing namespaces in tests. * Update to use new docgen. * Began making arrays namespace. * Updated to use new arrays and diagnostics namespaces. * Updated names for claims * Started extracting measurements from Paulis.qs. * Updated namespaces in tests as well. * Updating chemistry for most recent changes. * Added ForEach, used to simplify measurements. * Updating deprecated Q# syntax. * Minor fix for XML error. * Fixed infinite recursion in deprecation stubs. * Started trying to reduce # of warnings. * Fixed some minor build errors. * Resolved a couple TODOs. * Removed BigEndian support. * Resolved warnings due to && and ||. * Update Standard/src/Arithmetic/Shorthand.qs Co-Authored-By: cgranade <cgranade@gmail.com> * Addressing feedback. * Claim → Fact * Moved MeasureInteger back to Microsoft.Quantum.Arithmetic. * Resolved more deprecated syntax. * Removed one more LE suffix. * Addressing feedback. * Cgranade/complete 0.6 move (#57) * Revert "Begin refactoring standard libraries (#39)" (#56) As Chris pointed out, reverting these breaking changes until we have a chance to change everything... * Complete move of standard library refactoring to release branch This reverts commit 058048983c4d0509e5d522888d3d47ae49cd300e. * Explicitly qualify all names in M.Q.Ext.Math. (#74) * Explicitly qualify all names in M.Q.Ext.Math. * Fixed two missing qualified names. * Removed more occurances of M.Q.Ext.Math. * Removed Microsoft.Quantum.Extensions.Math from tests as well. * Reverted slight change to QuantumROM. * New array functions (#75) * Added new IndexRange function to eliminate `-1` in for loops. * Added some missing open statements. * New Enumerated function. * Port library and test code to new 0.6 names to reduce warning count. (#72) * Updating to use new syntax, namespace names, etc. * More primitive → intrinsic. * Updated test project to use beta version. * Updated chemistry proiects to beta. * Finding a few more calls to deprecated fns. * Cleaned up some assert and qcvv tests. * Removed uses of deprecated IntArrayFromRange * Resolved some more deprecated functions and ops. * Minor maintenance in QubitizationTests. * Bumped versions to latest beta. * Some trivial change to retrigger build. * Resolved package downgrade. * Move Microsoft.Quantum.Math.Complex UDT and resolve Microsoft.Quantum.Diagnostics deprecation stubs. (#77) * More primitive → intrinsic. * Finding a few more calls to deprecated fns. * Resolved some more deprecated functions and ops. * Minor maintenance in QubitizationTests. * Bumped versions to latest beta. * Resolved package downgrade. * Use Complex UDT at its new name. * Adapted tests. * A few more test adaptations. * Updated name of AssertQubitState to 0.6 name. * Fixes to chemistry. * Getting updates from master (#80) * Revert "Begin refactoring standard libraries (#39)" (#56) As Chris pointed out, reverting these breaking changes until we have a chance to change everything... * Missing return statement when compiling more than one Q# snippet from Python. (#60) * Fixing bug * Adding tests * Change Assembly.Version to Python.Version. (#64) * Prevent loading Q# modules when Python client is busy. (#71) * Prevent loading Q# modules when Python client is busy. * Linux build failed with some unrelated problem. Committing. * modifying contructor calls for QArray in preparation for a simulation framework change (#78) * Revert "Revert "Begin refactoring standard libraries (#39)" (#56)" This reverts commit 058048983c4d0509e5d522888d3d47ae49cd300e. * Update to 0.6.1904.1302-beta. (#81) * Update to 0.6.1904.1302-beta. * Removed deprecation warnings for Microsoft.Quantum.Math. * Resolved a few more deprecations. * Resolved a few more deprecation warnings. * A few more deprecation resolutions. * Removed some duplicate namespace opens. * Slight code cleanup. * Addressed feedback from @bettinaheim. * Standard.sln builds again, Standard.sln builds (#84) * Gulow/v0.6 chemistry deprecation (#82) * Update to 0.6.1904.1302-beta. * Removed deprecation warnings for Microsoft.Quantum.Math. * Resolved a few more deprecations. * Resolved a few more deprecation warnings. * A few more deprecation resolutions. * Removed some duplicate namespace opens. * Slight code cleanup. * Update test * . * Remove deprecated operations from chemistry and dependencies. * Fix comments * Update to use 0.65 syntax from latest beta. (#87) * Ported stateprep.qs to 0.65 syntax. * Fixed deprecation in test. * Updated to latest beta. * Fix mutable array issue in chemistry data model. (#88) * Explicitly call new QArray. (#89) * do not rely on collections.immutable (#93) * Continue migrating libraries to Q# 0.6 (#91) * Continue migrating to 0.65 syntax and applying style guidance. * A bit more progress normalizing private names. * Resolved more deprecated syntax, updated a name. * Resolved some more syntax warnings. * Ported more syntax and updated more names. * Resolved all remaining compile-time warnings in Standard. * Addressed all Q#-level compile-time warnings in chem. * Migrated a bit more syntax and updated to newest beta. * Moved to using intrinsic warnings. * Fixed endianness of exact QFT. * Fixed Microsoft.Quantum.Warnings. * Addressing @bettinaheim's feedback. * Removed some warnings in unit tests. * Adding DocsOutDir for single doc output location across projects. (#94) * Adding DocsOutDir for single doc output location across projects. * Begin adding more classical math functions for BigInt. (#96) * Begin adding more classical math functions for BigInt. * Addressing @beheim's feedback. * Minor fixes. * Bump to latest beta. * Fixed two minor bugs. * Fixed the type of signs. * Bump version to released packages.
2019-05-04 01:44:41 +03:00
let dblArray = ConstantArray(71, 2.17);
EqualityFactI(Length(dblArray), 71, $"ConstantArray(Int, Double) had the wrong length.");
let ignore = Mapped(NearEqualityFactD(_, 2.17), dblArray);
}
2019-11-22 22:25:20 +03:00
@Test("QuantumSimulator")
function ConstantArrayOfFunctionsIsCorrect() : Unit {
Release v0.6 to master. (#98) * Begin refactoring standard libraries (#39) * Began splitting up namespaces. * Began refactoring tests. * Updated chemistry src and tests for new namespaces. * Remove unused opens. * Began renaming operations and functions. * Separated out and updated ApplyReversed*. * Updated BE ↔ LE type conversions. * Added new transformed operation fns. * Whitespace fix * Eliminated some redundant code in applyreversed * Fixed deprecation comments. * Began working on refactoring With. * Refactored With further. * More renaming for consistency with LE/BE suffix convention. * Added Zip3, Zip4 * Added shorthand for MAJ and updated some type conv. * Fixed a typo in Zip4. * Separated out and updated arithmetic measurements. * Other minor maintenance changes. * Started separating out modular arithmetic. * Began refactoring ripple-carry comparators. * Refactored integer increment operations. * Fixed some See Also blocks. * Some minor progress. * Moved new arithmetic functionality into right folders. * Renamed integer arithmetic namespaces. * Split out qecc namespace. * Added documentation file for Microsoft.Quantum.ErrorCorrection. * Progress on renaming type conversion functions. * More progress on updating type conversion names. * Split out AA namespace. * Split out oracles namespace as well. * Renamed UDTs to remove "AmpAmp" prefix. This prefix is now implied by the Microsoft.Quantum.AmplitudeAmplification namespace. * Renamed some Qecc operations/fns * Moved more conversions into Convert.qs. * Updated some deprecated syntax. * Split out M.Q.Convert. * Added missing open stmt. * Started separating out classical math. * Began separating out QCVV. * Fixing namespaces in tests. * Update to use new docgen. * Began making arrays namespace. * Updated to use new arrays and diagnostics namespaces. * Updated names for claims * Started extracting measurements from Paulis.qs. * Updated namespaces in tests as well. * Updating chemistry for most recent changes. * Added ForEach, used to simplify measurements. * Updating deprecated Q# syntax. * Minor fix for XML error. * Fixed infinite recursion in deprecation stubs. * Started trying to reduce # of warnings. * Fixed some minor build errors. * Resolved a couple TODOs. * Removed BigEndian support. * Resolved warnings due to && and ||. * Update Standard/src/Arithmetic/Shorthand.qs Co-Authored-By: cgranade <cgranade@gmail.com> * Addressing feedback. * Claim → Fact * Moved MeasureInteger back to Microsoft.Quantum.Arithmetic. * Resolved more deprecated syntax. * Removed one more LE suffix. * Addressing feedback. * Cgranade/complete 0.6 move (#57) * Revert "Begin refactoring standard libraries (#39)" (#56) As Chris pointed out, reverting these breaking changes until we have a chance to change everything... * Complete move of standard library refactoring to release branch This reverts commit 058048983c4d0509e5d522888d3d47ae49cd300e. * Explicitly qualify all names in M.Q.Ext.Math. (#74) * Explicitly qualify all names in M.Q.Ext.Math. * Fixed two missing qualified names. * Removed more occurances of M.Q.Ext.Math. * Removed Microsoft.Quantum.Extensions.Math from tests as well. * Reverted slight change to QuantumROM. * New array functions (#75) * Added new IndexRange function to eliminate `-1` in for loops. * Added some missing open statements. * New Enumerated function. * Port library and test code to new 0.6 names to reduce warning count. (#72) * Updating to use new syntax, namespace names, etc. * More primitive → intrinsic. * Updated test project to use beta version. * Updated chemistry proiects to beta. * Finding a few more calls to deprecated fns. * Cleaned up some assert and qcvv tests. * Removed uses of deprecated IntArrayFromRange * Resolved some more deprecated functions and ops. * Minor maintenance in QubitizationTests. * Bumped versions to latest beta. * Some trivial change to retrigger build. * Resolved package downgrade. * Move Microsoft.Quantum.Math.Complex UDT and resolve Microsoft.Quantum.Diagnostics deprecation stubs. (#77) * More primitive → intrinsic. * Finding a few more calls to deprecated fns. * Resolved some more deprecated functions and ops. * Minor maintenance in QubitizationTests. * Bumped versions to latest beta. * Resolved package downgrade. * Use Complex UDT at its new name. * Adapted tests. * A few more test adaptations. * Updated name of AssertQubitState to 0.6 name. * Fixes to chemistry. * Getting updates from master (#80) * Revert "Begin refactoring standard libraries (#39)" (#56) As Chris pointed out, reverting these breaking changes until we have a chance to change everything... * Missing return statement when compiling more than one Q# snippet from Python. (#60) * Fixing bug * Adding tests * Change Assembly.Version to Python.Version. (#64) * Prevent loading Q# modules when Python client is busy. (#71) * Prevent loading Q# modules when Python client is busy. * Linux build failed with some unrelated problem. Committing. * modifying contructor calls for QArray in preparation for a simulation framework change (#78) * Revert "Revert "Begin refactoring standard libraries (#39)" (#56)" This reverts commit 058048983c4d0509e5d522888d3d47ae49cd300e. * Update to 0.6.1904.1302-beta. (#81) * Update to 0.6.1904.1302-beta. * Removed deprecation warnings for Microsoft.Quantum.Math. * Resolved a few more deprecations. * Resolved a few more deprecation warnings. * A few more deprecation resolutions. * Removed some duplicate namespace opens. * Slight code cleanup. * Addressed feedback from @bettinaheim. * Standard.sln builds again, Standard.sln builds (#84) * Gulow/v0.6 chemistry deprecation (#82) * Update to 0.6.1904.1302-beta. * Removed deprecation warnings for Microsoft.Quantum.Math. * Resolved a few more deprecations. * Resolved a few more deprecation warnings. * A few more deprecation resolutions. * Removed some duplicate namespace opens. * Slight code cleanup. * Update test * . * Remove deprecated operations from chemistry and dependencies. * Fix comments * Update to use 0.65 syntax from latest beta. (#87) * Ported stateprep.qs to 0.65 syntax. * Fixed deprecation in test. * Updated to latest beta. * Fix mutable array issue in chemistry data model. (#88) * Explicitly call new QArray. (#89) * do not rely on collections.immutable (#93) * Continue migrating libraries to Q# 0.6 (#91) * Continue migrating to 0.65 syntax and applying style guidance. * A bit more progress normalizing private names. * Resolved more deprecated syntax, updated a name. * Resolved some more syntax warnings. * Ported more syntax and updated more names. * Resolved all remaining compile-time warnings in Standard. * Addressed all Q#-level compile-time warnings in chem. * Migrated a bit more syntax and updated to newest beta. * Moved to using intrinsic warnings. * Fixed endianness of exact QFT. * Fixed Microsoft.Quantum.Warnings. * Addressing @bettinaheim's feedback. * Removed some warnings in unit tests. * Adding DocsOutDir for single doc output location across projects. (#94) * Adding DocsOutDir for single doc output location across projects. * Begin adding more classical math functions for BigInt. (#96) * Begin adding more classical math functions for BigInt. * Addressing @beheim's feedback. * Minor fixes. * Bump to latest beta. * Fixed two minor bugs. * Fixed the type of signs. * Bump version to released packages.
2019-05-04 01:44:41 +03:00
// Stress test by making an array of Int -> Int.
let fnArray = ConstantArray(7, Squared);
Release v0.6 to master. (#98) * Begin refactoring standard libraries (#39) * Began splitting up namespaces. * Began refactoring tests. * Updated chemistry src and tests for new namespaces. * Remove unused opens. * Began renaming operations and functions. * Separated out and updated ApplyReversed*. * Updated BE ↔ LE type conversions. * Added new transformed operation fns. * Whitespace fix * Eliminated some redundant code in applyreversed * Fixed deprecation comments. * Began working on refactoring With. * Refactored With further. * More renaming for consistency with LE/BE suffix convention. * Added Zip3, Zip4 * Added shorthand for MAJ and updated some type conv. * Fixed a typo in Zip4. * Separated out and updated arithmetic measurements. * Other minor maintenance changes. * Started separating out modular arithmetic. * Began refactoring ripple-carry comparators. * Refactored integer increment operations. * Fixed some See Also blocks. * Some minor progress. * Moved new arithmetic functionality into right folders. * Renamed integer arithmetic namespaces. * Split out qecc namespace. * Added documentation file for Microsoft.Quantum.ErrorCorrection. * Progress on renaming type conversion functions. * More progress on updating type conversion names. * Split out AA namespace. * Split out oracles namespace as well. * Renamed UDTs to remove "AmpAmp" prefix. This prefix is now implied by the Microsoft.Quantum.AmplitudeAmplification namespace. * Renamed some Qecc operations/fns * Moved more conversions into Convert.qs. * Updated some deprecated syntax. * Split out M.Q.Convert. * Added missing open stmt. * Started separating out classical math. * Began separating out QCVV. * Fixing namespaces in tests. * Update to use new docgen. * Began making arrays namespace. * Updated to use new arrays and diagnostics namespaces. * Updated names for claims * Started extracting measurements from Paulis.qs. * Updated namespaces in tests as well. * Updating chemistry for most recent changes. * Added ForEach, used to simplify measurements. * Updating deprecated Q# syntax. * Minor fix for XML error. * Fixed infinite recursion in deprecation stubs. * Started trying to reduce # of warnings. * Fixed some minor build errors. * Resolved a couple TODOs. * Removed BigEndian support. * Resolved warnings due to && and ||. * Update Standard/src/Arithmetic/Shorthand.qs Co-Authored-By: cgranade <cgranade@gmail.com> * Addressing feedback. * Claim → Fact * Moved MeasureInteger back to Microsoft.Quantum.Arithmetic. * Resolved more deprecated syntax. * Removed one more LE suffix. * Addressing feedback. * Cgranade/complete 0.6 move (#57) * Revert "Begin refactoring standard libraries (#39)" (#56) As Chris pointed out, reverting these breaking changes until we have a chance to change everything... * Complete move of standard library refactoring to release branch This reverts commit 058048983c4d0509e5d522888d3d47ae49cd300e. * Explicitly qualify all names in M.Q.Ext.Math. (#74) * Explicitly qualify all names in M.Q.Ext.Math. * Fixed two missing qualified names. * Removed more occurances of M.Q.Ext.Math. * Removed Microsoft.Quantum.Extensions.Math from tests as well. * Reverted slight change to QuantumROM. * New array functions (#75) * Added new IndexRange function to eliminate `-1` in for loops. * Added some missing open statements. * New Enumerated function. * Port library and test code to new 0.6 names to reduce warning count. (#72) * Updating to use new syntax, namespace names, etc. * More primitive → intrinsic. * Updated test project to use beta version. * Updated chemistry proiects to beta. * Finding a few more calls to deprecated fns. * Cleaned up some assert and qcvv tests. * Removed uses of deprecated IntArrayFromRange * Resolved some more deprecated functions and ops. * Minor maintenance in QubitizationTests. * Bumped versions to latest beta. * Some trivial change to retrigger build. * Resolved package downgrade. * Move Microsoft.Quantum.Math.Complex UDT and resolve Microsoft.Quantum.Diagnostics deprecation stubs. (#77) * More primitive → intrinsic. * Finding a few more calls to deprecated fns. * Resolved some more deprecated functions and ops. * Minor maintenance in QubitizationTests. * Bumped versions to latest beta. * Resolved package downgrade. * Use Complex UDT at its new name. * Adapted tests. * A few more test adaptations. * Updated name of AssertQubitState to 0.6 name. * Fixes to chemistry. * Getting updates from master (#80) * Revert "Begin refactoring standard libraries (#39)" (#56) As Chris pointed out, reverting these breaking changes until we have a chance to change everything... * Missing return statement when compiling more than one Q# snippet from Python. (#60) * Fixing bug * Adding tests * Change Assembly.Version to Python.Version. (#64) * Prevent loading Q# modules when Python client is busy. (#71) * Prevent loading Q# modules when Python client is busy. * Linux build failed with some unrelated problem. Committing. * modifying contructor calls for QArray in preparation for a simulation framework change (#78) * Revert "Revert "Begin refactoring standard libraries (#39)" (#56)" This reverts commit 058048983c4d0509e5d522888d3d47ae49cd300e. * Update to 0.6.1904.1302-beta. (#81) * Update to 0.6.1904.1302-beta. * Removed deprecation warnings for Microsoft.Quantum.Math. * Resolved a few more deprecations. * Resolved a few more deprecation warnings. * A few more deprecation resolutions. * Removed some duplicate namespace opens. * Slight code cleanup. * Addressed feedback from @bettinaheim. * Standard.sln builds again, Standard.sln builds (#84) * Gulow/v0.6 chemistry deprecation (#82) * Update to 0.6.1904.1302-beta. * Removed deprecation warnings for Microsoft.Quantum.Math. * Resolved a few more deprecations. * Resolved a few more deprecation warnings. * A few more deprecation resolutions. * Removed some duplicate namespace opens. * Slight code cleanup. * Update test * . * Remove deprecated operations from chemistry and dependencies. * Fix comments * Update to use 0.65 syntax from latest beta. (#87) * Ported stateprep.qs to 0.65 syntax. * Fixed deprecation in test. * Updated to latest beta. * Fix mutable array issue in chemistry data model. (#88) * Explicitly call new QArray. (#89) * do not rely on collections.immutable (#93) * Continue migrating libraries to Q# 0.6 (#91) * Continue migrating to 0.65 syntax and applying style guidance. * A bit more progress normalizing private names. * Resolved more deprecated syntax, updated a name. * Resolved some more syntax warnings. * Ported more syntax and updated more names. * Resolved all remaining compile-time warnings in Standard. * Addressed all Q#-level compile-time warnings in chem. * Migrated a bit more syntax and updated to newest beta. * Moved to using intrinsic warnings. * Fixed endianness of exact QFT. * Fixed Microsoft.Quantum.Warnings. * Addressing @bettinaheim's feedback. * Removed some warnings in unit tests. * Adding DocsOutDir for single doc output location across projects. (#94) * Adding DocsOutDir for single doc output location across projects. * Begin adding more classical math functions for BigInt. (#96) * Begin adding more classical math functions for BigInt. * Addressing @beheim's feedback. * Minor fixes. * Bump to latest beta. * Fixed two minor bugs. * Fixed the type of signs. * Bump version to released packages.
2019-05-04 01:44:41 +03:00
EqualityFactI(Length(fnArray), 7, $"ConstantArray(Int, Int -> Int) had the wrong length.");
EqualityFactI(fnArray[3](7), 49, $"ConstantArray(Int, Int -> Int) had the wrong value.");
}
2019-11-22 22:25:20 +03:00
@Test("QuantumSimulator")
function SubarrayIsCorrect () : Unit {
Release v0.6 to master. (#98) * Begin refactoring standard libraries (#39) * Began splitting up namespaces. * Began refactoring tests. * Updated chemistry src and tests for new namespaces. * Remove unused opens. * Began renaming operations and functions. * Separated out and updated ApplyReversed*. * Updated BE ↔ LE type conversions. * Added new transformed operation fns. * Whitespace fix * Eliminated some redundant code in applyreversed * Fixed deprecation comments. * Began working on refactoring With. * Refactored With further. * More renaming for consistency with LE/BE suffix convention. * Added Zip3, Zip4 * Added shorthand for MAJ and updated some type conv. * Fixed a typo in Zip4. * Separated out and updated arithmetic measurements. * Other minor maintenance changes. * Started separating out modular arithmetic. * Began refactoring ripple-carry comparators. * Refactored integer increment operations. * Fixed some See Also blocks. * Some minor progress. * Moved new arithmetic functionality into right folders. * Renamed integer arithmetic namespaces. * Split out qecc namespace. * Added documentation file for Microsoft.Quantum.ErrorCorrection. * Progress on renaming type conversion functions. * More progress on updating type conversion names. * Split out AA namespace. * Split out oracles namespace as well. * Renamed UDTs to remove "AmpAmp" prefix. This prefix is now implied by the Microsoft.Quantum.AmplitudeAmplification namespace. * Renamed some Qecc operations/fns * Moved more conversions into Convert.qs. * Updated some deprecated syntax. * Split out M.Q.Convert. * Added missing open stmt. * Started separating out classical math. * Began separating out QCVV. * Fixing namespaces in tests. * Update to use new docgen. * Began making arrays namespace. * Updated to use new arrays and diagnostics namespaces. * Updated names for claims * Started extracting measurements from Paulis.qs. * Updated namespaces in tests as well. * Updating chemistry for most recent changes. * Added ForEach, used to simplify measurements. * Updating deprecated Q# syntax. * Minor fix for XML error. * Fixed infinite recursion in deprecation stubs. * Started trying to reduce # of warnings. * Fixed some minor build errors. * Resolved a couple TODOs. * Removed BigEndian support. * Resolved warnings due to && and ||. * Update Standard/src/Arithmetic/Shorthand.qs Co-Authored-By: cgranade <cgranade@gmail.com> * Addressing feedback. * Claim → Fact * Moved MeasureInteger back to Microsoft.Quantum.Arithmetic. * Resolved more deprecated syntax. * Removed one more LE suffix. * Addressing feedback. * Cgranade/complete 0.6 move (#57) * Revert "Begin refactoring standard libraries (#39)" (#56) As Chris pointed out, reverting these breaking changes until we have a chance to change everything... * Complete move of standard library refactoring to release branch This reverts commit 058048983c4d0509e5d522888d3d47ae49cd300e. * Explicitly qualify all names in M.Q.Ext.Math. (#74) * Explicitly qualify all names in M.Q.Ext.Math. * Fixed two missing qualified names. * Removed more occurances of M.Q.Ext.Math. * Removed Microsoft.Quantum.Extensions.Math from tests as well. * Reverted slight change to QuantumROM. * New array functions (#75) * Added new IndexRange function to eliminate `-1` in for loops. * Added some missing open statements. * New Enumerated function. * Port library and test code to new 0.6 names to reduce warning count. (#72) * Updating to use new syntax, namespace names, etc. * More primitive → intrinsic. * Updated test project to use beta version. * Updated chemistry proiects to beta. * Finding a few more calls to deprecated fns. * Cleaned up some assert and qcvv tests. * Removed uses of deprecated IntArrayFromRange * Resolved some more deprecated functions and ops. * Minor maintenance in QubitizationTests. * Bumped versions to latest beta. * Some trivial change to retrigger build. * Resolved package downgrade. * Move Microsoft.Quantum.Math.Complex UDT and resolve Microsoft.Quantum.Diagnostics deprecation stubs. (#77) * More primitive → intrinsic. * Finding a few more calls to deprecated fns. * Resolved some more deprecated functions and ops. * Minor maintenance in QubitizationTests. * Bumped versions to latest beta. * Resolved package downgrade. * Use Complex UDT at its new name. * Adapted tests. * A few more test adaptations. * Updated name of AssertQubitState to 0.6 name. * Fixes to chemistry. * Getting updates from master (#80) * Revert "Begin refactoring standard libraries (#39)" (#56) As Chris pointed out, reverting these breaking changes until we have a chance to change everything... * Missing return statement when compiling more than one Q# snippet from Python. (#60) * Fixing bug * Adding tests * Change Assembly.Version to Python.Version. (#64) * Prevent loading Q# modules when Python client is busy. (#71) * Prevent loading Q# modules when Python client is busy. * Linux build failed with some unrelated problem. Committing. * modifying contructor calls for QArray in preparation for a simulation framework change (#78) * Revert "Revert "Begin refactoring standard libraries (#39)" (#56)" This reverts commit 058048983c4d0509e5d522888d3d47ae49cd300e. * Update to 0.6.1904.1302-beta. (#81) * Update to 0.6.1904.1302-beta. * Removed deprecation warnings for Microsoft.Quantum.Math. * Resolved a few more deprecations. * Resolved a few more deprecation warnings. * A few more deprecation resolutions. * Removed some duplicate namespace opens. * Slight code cleanup. * Addressed feedback from @bettinaheim. * Standard.sln builds again, Standard.sln builds (#84) * Gulow/v0.6 chemistry deprecation (#82) * Update to 0.6.1904.1302-beta. * Removed deprecation warnings for Microsoft.Quantum.Math. * Resolved a few more deprecations. * Resolved a few more deprecation warnings. * A few more deprecation resolutions. * Removed some duplicate namespace opens. * Slight code cleanup. * Update test * . * Remove deprecated operations from chemistry and dependencies. * Fix comments * Update to use 0.65 syntax from latest beta. (#87) * Ported stateprep.qs to 0.65 syntax. * Fixed deprecation in test. * Updated to latest beta. * Fix mutable array issue in chemistry data model. (#88) * Explicitly call new QArray. (#89) * do not rely on collections.immutable (#93) * Continue migrating libraries to Q# 0.6 (#91) * Continue migrating to 0.65 syntax and applying style guidance. * A bit more progress normalizing private names. * Resolved more deprecated syntax, updated a name. * Resolved some more syntax warnings. * Ported more syntax and updated more names. * Resolved all remaining compile-time warnings in Standard. * Addressed all Q#-level compile-time warnings in chem. * Migrated a bit more syntax and updated to newest beta. * Moved to using intrinsic warnings. * Fixed endianness of exact QFT. * Fixed Microsoft.Quantum.Warnings. * Addressing @bettinaheim's feedback. * Removed some warnings in unit tests. * Adding DocsOutDir for single doc output location across projects. (#94) * Adding DocsOutDir for single doc output location across projects. * Begin adding more classical math functions for BigInt. (#96) * Begin adding more classical math functions for BigInt. * Addressing @beheim's feedback. * Minor fixes. * Bump to latest beta. * Fixed two minor bugs. * Fixed the type of signs. * Bump version to released packages.
2019-05-04 01:44:41 +03:00
let array0 = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
let subarrayOdd = Subarray([1, 3, 5, 7, 9], array0);
let subarrayEven = Subarray([0, 2, 4, 6, 8, 10], array0);
Fact(All(IsEven, subarrayEven), $"the even elements of [1..10] were not correctly sliced.");
Fact(not Any(IsEven, subarrayOdd), $"the odd elements of [1..10] were not correctly sliced.");
Release v0.6 to master. (#98) * Begin refactoring standard libraries (#39) * Began splitting up namespaces. * Began refactoring tests. * Updated chemistry src and tests for new namespaces. * Remove unused opens. * Began renaming operations and functions. * Separated out and updated ApplyReversed*. * Updated BE ↔ LE type conversions. * Added new transformed operation fns. * Whitespace fix * Eliminated some redundant code in applyreversed * Fixed deprecation comments. * Began working on refactoring With. * Refactored With further. * More renaming for consistency with LE/BE suffix convention. * Added Zip3, Zip4 * Added shorthand for MAJ and updated some type conv. * Fixed a typo in Zip4. * Separated out and updated arithmetic measurements. * Other minor maintenance changes. * Started separating out modular arithmetic. * Began refactoring ripple-carry comparators. * Refactored integer increment operations. * Fixed some See Also blocks. * Some minor progress. * Moved new arithmetic functionality into right folders. * Renamed integer arithmetic namespaces. * Split out qecc namespace. * Added documentation file for Microsoft.Quantum.ErrorCorrection. * Progress on renaming type conversion functions. * More progress on updating type conversion names. * Split out AA namespace. * Split out oracles namespace as well. * Renamed UDTs to remove "AmpAmp" prefix. This prefix is now implied by the Microsoft.Quantum.AmplitudeAmplification namespace. * Renamed some Qecc operations/fns * Moved more conversions into Convert.qs. * Updated some deprecated syntax. * Split out M.Q.Convert. * Added missing open stmt. * Started separating out classical math. * Began separating out QCVV. * Fixing namespaces in tests. * Update to use new docgen. * Began making arrays namespace. * Updated to use new arrays and diagnostics namespaces. * Updated names for claims * Started extracting measurements from Paulis.qs. * Updated namespaces in tests as well. * Updating chemistry for most recent changes. * Added ForEach, used to simplify measurements. * Updating deprecated Q# syntax. * Minor fix for XML error. * Fixed infinite recursion in deprecation stubs. * Started trying to reduce # of warnings. * Fixed some minor build errors. * Resolved a couple TODOs. * Removed BigEndian support. * Resolved warnings due to && and ||. * Update Standard/src/Arithmetic/Shorthand.qs Co-Authored-By: cgranade <cgranade@gmail.com> * Addressing feedback. * Claim → Fact * Moved MeasureInteger back to Microsoft.Quantum.Arithmetic. * Resolved more deprecated syntax. * Removed one more LE suffix. * Addressing feedback. * Cgranade/complete 0.6 move (#57) * Revert "Begin refactoring standard libraries (#39)" (#56) As Chris pointed out, reverting these breaking changes until we have a chance to change everything... * Complete move of standard library refactoring to release branch This reverts commit 058048983c4d0509e5d522888d3d47ae49cd300e. * Explicitly qualify all names in M.Q.Ext.Math. (#74) * Explicitly qualify all names in M.Q.Ext.Math. * Fixed two missing qualified names. * Removed more occurances of M.Q.Ext.Math. * Removed Microsoft.Quantum.Extensions.Math from tests as well. * Reverted slight change to QuantumROM. * New array functions (#75) * Added new IndexRange function to eliminate `-1` in for loops. * Added some missing open statements. * New Enumerated function. * Port library and test code to new 0.6 names to reduce warning count. (#72) * Updating to use new syntax, namespace names, etc. * More primitive → intrinsic. * Updated test project to use beta version. * Updated chemistry proiects to beta. * Finding a few more calls to deprecated fns. * Cleaned up some assert and qcvv tests. * Removed uses of deprecated IntArrayFromRange * Resolved some more deprecated functions and ops. * Minor maintenance in QubitizationTests. * Bumped versions to latest beta. * Some trivial change to retrigger build. * Resolved package downgrade. * Move Microsoft.Quantum.Math.Complex UDT and resolve Microsoft.Quantum.Diagnostics deprecation stubs. (#77) * More primitive → intrinsic. * Finding a few more calls to deprecated fns. * Resolved some more deprecated functions and ops. * Minor maintenance in QubitizationTests. * Bumped versions to latest beta. * Resolved package downgrade. * Use Complex UDT at its new name. * Adapted tests. * A few more test adaptations. * Updated name of AssertQubitState to 0.6 name. * Fixes to chemistry. * Getting updates from master (#80) * Revert "Begin refactoring standard libraries (#39)" (#56) As Chris pointed out, reverting these breaking changes until we have a chance to change everything... * Missing return statement when compiling more than one Q# snippet from Python. (#60) * Fixing bug * Adding tests * Change Assembly.Version to Python.Version. (#64) * Prevent loading Q# modules when Python client is busy. (#71) * Prevent loading Q# modules when Python client is busy. * Linux build failed with some unrelated problem. Committing. * modifying contructor calls for QArray in preparation for a simulation framework change (#78) * Revert "Revert "Begin refactoring standard libraries (#39)" (#56)" This reverts commit 058048983c4d0509e5d522888d3d47ae49cd300e. * Update to 0.6.1904.1302-beta. (#81) * Update to 0.6.1904.1302-beta. * Removed deprecation warnings for Microsoft.Quantum.Math. * Resolved a few more deprecations. * Resolved a few more deprecation warnings. * A few more deprecation resolutions. * Removed some duplicate namespace opens. * Slight code cleanup. * Addressed feedback from @bettinaheim. * Standard.sln builds again, Standard.sln builds (#84) * Gulow/v0.6 chemistry deprecation (#82) * Update to 0.6.1904.1302-beta. * Removed deprecation warnings for Microsoft.Quantum.Math. * Resolved a few more deprecations. * Resolved a few more deprecation warnings. * A few more deprecation resolutions. * Removed some duplicate namespace opens. * Slight code cleanup. * Update test * . * Remove deprecated operations from chemistry and dependencies. * Fix comments * Update to use 0.65 syntax from latest beta. (#87) * Ported stateprep.qs to 0.65 syntax. * Fixed deprecation in test. * Updated to latest beta. * Fix mutable array issue in chemistry data model. (#88) * Explicitly call new QArray. (#89) * do not rely on collections.immutable (#93) * Continue migrating libraries to Q# 0.6 (#91) * Continue migrating to 0.65 syntax and applying style guidance. * A bit more progress normalizing private names. * Resolved more deprecated syntax, updated a name. * Resolved some more syntax warnings. * Ported more syntax and updated more names. * Resolved all remaining compile-time warnings in Standard. * Addressed all Q#-level compile-time warnings in chem. * Migrated a bit more syntax and updated to newest beta. * Moved to using intrinsic warnings. * Fixed endianness of exact QFT. * Fixed Microsoft.Quantum.Warnings. * Addressing @bettinaheim's feedback. * Removed some warnings in unit tests. * Adding DocsOutDir for single doc output location across projects. (#94) * Adding DocsOutDir for single doc output location across projects. * Begin adding more classical math functions for BigInt. (#96) * Begin adding more classical math functions for BigInt. * Addressing @beheim's feedback. * Minor fixes. * Bump to latest beta. * Fixed two minor bugs. * Fixed the type of signs. * Bump version to released packages.
2019-05-04 01:44:41 +03:00
let array1 = [10, 11, 12, 13];
Ignore(Mapped(EqualityFactI(_, _, $"Subarray failed: subpermutation case."), Zipped([12, 11], Subarray([2, 1], array1))));
Release v0.6 to master. (#98) * Begin refactoring standard libraries (#39) * Began splitting up namespaces. * Began refactoring tests. * Updated chemistry src and tests for new namespaces. * Remove unused opens. * Began renaming operations and functions. * Separated out and updated ApplyReversed*. * Updated BE ↔ LE type conversions. * Added new transformed operation fns. * Whitespace fix * Eliminated some redundant code in applyreversed * Fixed deprecation comments. * Began working on refactoring With. * Refactored With further. * More renaming for consistency with LE/BE suffix convention. * Added Zip3, Zip4 * Added shorthand for MAJ and updated some type conv. * Fixed a typo in Zip4. * Separated out and updated arithmetic measurements. * Other minor maintenance changes. * Started separating out modular arithmetic. * Began refactoring ripple-carry comparators. * Refactored integer increment operations. * Fixed some See Also blocks. * Some minor progress. * Moved new arithmetic functionality into right folders. * Renamed integer arithmetic namespaces. * Split out qecc namespace. * Added documentation file for Microsoft.Quantum.ErrorCorrection. * Progress on renaming type conversion functions. * More progress on updating type conversion names. * Split out AA namespace. * Split out oracles namespace as well. * Renamed UDTs to remove "AmpAmp" prefix. This prefix is now implied by the Microsoft.Quantum.AmplitudeAmplification namespace. * Renamed some Qecc operations/fns * Moved more conversions into Convert.qs. * Updated some deprecated syntax. * Split out M.Q.Convert. * Added missing open stmt. * Started separating out classical math. * Began separating out QCVV. * Fixing namespaces in tests. * Update to use new docgen. * Began making arrays namespace. * Updated to use new arrays and diagnostics namespaces. * Updated names for claims * Started extracting measurements from Paulis.qs. * Updated namespaces in tests as well. * Updating chemistry for most recent changes. * Added ForEach, used to simplify measurements. * Updating deprecated Q# syntax. * Minor fix for XML error. * Fixed infinite recursion in deprecation stubs. * Started trying to reduce # of warnings. * Fixed some minor build errors. * Resolved a couple TODOs. * Removed BigEndian support. * Resolved warnings due to && and ||. * Update Standard/src/Arithmetic/Shorthand.qs Co-Authored-By: cgranade <cgranade@gmail.com> * Addressing feedback. * Claim → Fact * Moved MeasureInteger back to Microsoft.Quantum.Arithmetic. * Resolved more deprecated syntax. * Removed one more LE suffix. * Addressing feedback. * Cgranade/complete 0.6 move (#57) * Revert "Begin refactoring standard libraries (#39)" (#56) As Chris pointed out, reverting these breaking changes until we have a chance to change everything... * Complete move of standard library refactoring to release branch This reverts commit 058048983c4d0509e5d522888d3d47ae49cd300e. * Explicitly qualify all names in M.Q.Ext.Math. (#74) * Explicitly qualify all names in M.Q.Ext.Math. * Fixed two missing qualified names. * Removed more occurances of M.Q.Ext.Math. * Removed Microsoft.Quantum.Extensions.Math from tests as well. * Reverted slight change to QuantumROM. * New array functions (#75) * Added new IndexRange function to eliminate `-1` in for loops. * Added some missing open statements. * New Enumerated function. * Port library and test code to new 0.6 names to reduce warning count. (#72) * Updating to use new syntax, namespace names, etc. * More primitive → intrinsic. * Updated test project to use beta version. * Updated chemistry proiects to beta. * Finding a few more calls to deprecated fns. * Cleaned up some assert and qcvv tests. * Removed uses of deprecated IntArrayFromRange * Resolved some more deprecated functions and ops. * Minor maintenance in QubitizationTests. * Bumped versions to latest beta. * Some trivial change to retrigger build. * Resolved package downgrade. * Move Microsoft.Quantum.Math.Complex UDT and resolve Microsoft.Quantum.Diagnostics deprecation stubs. (#77) * More primitive → intrinsic. * Finding a few more calls to deprecated fns. * Resolved some more deprecated functions and ops. * Minor maintenance in QubitizationTests. * Bumped versions to latest beta. * Resolved package downgrade. * Use Complex UDT at its new name. * Adapted tests. * A few more test adaptations. * Updated name of AssertQubitState to 0.6 name. * Fixes to chemistry. * Getting updates from master (#80) * Revert "Begin refactoring standard libraries (#39)" (#56) As Chris pointed out, reverting these breaking changes until we have a chance to change everything... * Missing return statement when compiling more than one Q# snippet from Python. (#60) * Fixing bug * Adding tests * Change Assembly.Version to Python.Version. (#64) * Prevent loading Q# modules when Python client is busy. (#71) * Prevent loading Q# modules when Python client is busy. * Linux build failed with some unrelated problem. Committing. * modifying contructor calls for QArray in preparation for a simulation framework change (#78) * Revert "Revert "Begin refactoring standard libraries (#39)" (#56)" This reverts commit 058048983c4d0509e5d522888d3d47ae49cd300e. * Update to 0.6.1904.1302-beta. (#81) * Update to 0.6.1904.1302-beta. * Removed deprecation warnings for Microsoft.Quantum.Math. * Resolved a few more deprecations. * Resolved a few more deprecation warnings. * A few more deprecation resolutions. * Removed some duplicate namespace opens. * Slight code cleanup. * Addressed feedback from @bettinaheim. * Standard.sln builds again, Standard.sln builds (#84) * Gulow/v0.6 chemistry deprecation (#82) * Update to 0.6.1904.1302-beta. * Removed deprecation warnings for Microsoft.Quantum.Math. * Resolved a few more deprecations. * Resolved a few more deprecation warnings. * A few more deprecation resolutions. * Removed some duplicate namespace opens. * Slight code cleanup. * Update test * . * Remove deprecated operations from chemistry and dependencies. * Fix comments * Update to use 0.65 syntax from latest beta. (#87) * Ported stateprep.qs to 0.65 syntax. * Fixed deprecation in test. * Updated to latest beta. * Fix mutable array issue in chemistry data model. (#88) * Explicitly call new QArray. (#89) * do not rely on collections.immutable (#93) * Continue migrating libraries to Q# 0.6 (#91) * Continue migrating to 0.65 syntax and applying style guidance. * A bit more progress normalizing private names. * Resolved more deprecated syntax, updated a name. * Resolved some more syntax warnings. * Ported more syntax and updated more names. * Resolved all remaining compile-time warnings in Standard. * Addressed all Q#-level compile-time warnings in chem. * Migrated a bit more syntax and updated to newest beta. * Moved to using intrinsic warnings. * Fixed endianness of exact QFT. * Fixed Microsoft.Quantum.Warnings. * Addressing @bettinaheim's feedback. * Removed some warnings in unit tests. * Adding DocsOutDir for single doc output location across projects. (#94) * Adding DocsOutDir for single doc output location across projects. * Begin adding more classical math functions for BigInt. (#96) * Begin adding more classical math functions for BigInt. * Addressing @beheim's feedback. * Minor fixes. * Bump to latest beta. * Fixed two minor bugs. * Fixed the type of signs. * Bump version to released packages.
2019-05-04 01:44:41 +03:00
}
2019-11-22 22:25:20 +03:00
@Test("QuantumSimulator")
function FilteredIsEvenHasNoOdds() : Unit {
Release v0.6 to master. (#98) * Begin refactoring standard libraries (#39) * Began splitting up namespaces. * Began refactoring tests. * Updated chemistry src and tests for new namespaces. * Remove unused opens. * Began renaming operations and functions. * Separated out and updated ApplyReversed*. * Updated BE ↔ LE type conversions. * Added new transformed operation fns. * Whitespace fix * Eliminated some redundant code in applyreversed * Fixed deprecation comments. * Began working on refactoring With. * Refactored With further. * More renaming for consistency with LE/BE suffix convention. * Added Zip3, Zip4 * Added shorthand for MAJ and updated some type conv. * Fixed a typo in Zip4. * Separated out and updated arithmetic measurements. * Other minor maintenance changes. * Started separating out modular arithmetic. * Began refactoring ripple-carry comparators. * Refactored integer increment operations. * Fixed some See Also blocks. * Some minor progress. * Moved new arithmetic functionality into right folders. * Renamed integer arithmetic namespaces. * Split out qecc namespace. * Added documentation file for Microsoft.Quantum.ErrorCorrection. * Progress on renaming type conversion functions. * More progress on updating type conversion names. * Split out AA namespace. * Split out oracles namespace as well. * Renamed UDTs to remove "AmpAmp" prefix. This prefix is now implied by the Microsoft.Quantum.AmplitudeAmplification namespace. * Renamed some Qecc operations/fns * Moved more conversions into Convert.qs. * Updated some deprecated syntax. * Split out M.Q.Convert. * Added missing open stmt. * Started separating out classical math. * Began separating out QCVV. * Fixing namespaces in tests. * Update to use new docgen. * Began making arrays namespace. * Updated to use new arrays and diagnostics namespaces. * Updated names for claims * Started extracting measurements from Paulis.qs. * Updated namespaces in tests as well. * Updating chemistry for most recent changes. * Added ForEach, used to simplify measurements. * Updating deprecated Q# syntax. * Minor fix for XML error. * Fixed infinite recursion in deprecation stubs. * Started trying to reduce # of warnings. * Fixed some minor build errors. * Resolved a couple TODOs. * Removed BigEndian support. * Resolved warnings due to && and ||. * Update Standard/src/Arithmetic/Shorthand.qs Co-Authored-By: cgranade <cgranade@gmail.com> * Addressing feedback. * Claim → Fact * Moved MeasureInteger back to Microsoft.Quantum.Arithmetic. * Resolved more deprecated syntax. * Removed one more LE suffix. * Addressing feedback. * Cgranade/complete 0.6 move (#57) * Revert "Begin refactoring standard libraries (#39)" (#56) As Chris pointed out, reverting these breaking changes until we have a chance to change everything... * Complete move of standard library refactoring to release branch This reverts commit 058048983c4d0509e5d522888d3d47ae49cd300e. * Explicitly qualify all names in M.Q.Ext.Math. (#74) * Explicitly qualify all names in M.Q.Ext.Math. * Fixed two missing qualified names. * Removed more occurances of M.Q.Ext.Math. * Removed Microsoft.Quantum.Extensions.Math from tests as well. * Reverted slight change to QuantumROM. * New array functions (#75) * Added new IndexRange function to eliminate `-1` in for loops. * Added some missing open statements. * New Enumerated function. * Port library and test code to new 0.6 names to reduce warning count. (#72) * Updating to use new syntax, namespace names, etc. * More primitive → intrinsic. * Updated test project to use beta version. * Updated chemistry proiects to beta. * Finding a few more calls to deprecated fns. * Cleaned up some assert and qcvv tests. * Removed uses of deprecated IntArrayFromRange * Resolved some more deprecated functions and ops. * Minor maintenance in QubitizationTests. * Bumped versions to latest beta. * Some trivial change to retrigger build. * Resolved package downgrade. * Move Microsoft.Quantum.Math.Complex UDT and resolve Microsoft.Quantum.Diagnostics deprecation stubs. (#77) * More primitive → intrinsic. * Finding a few more calls to deprecated fns. * Resolved some more deprecated functions and ops. * Minor maintenance in QubitizationTests. * Bumped versions to latest beta. * Resolved package downgrade. * Use Complex UDT at its new name. * Adapted tests. * A few more test adaptations. * Updated name of AssertQubitState to 0.6 name. * Fixes to chemistry. * Getting updates from master (#80) * Revert "Begin refactoring standard libraries (#39)" (#56) As Chris pointed out, reverting these breaking changes until we have a chance to change everything... * Missing return statement when compiling more than one Q# snippet from Python. (#60) * Fixing bug * Adding tests * Change Assembly.Version to Python.Version. (#64) * Prevent loading Q# modules when Python client is busy. (#71) * Prevent loading Q# modules when Python client is busy. * Linux build failed with some unrelated problem. Committing. * modifying contructor calls for QArray in preparation for a simulation framework change (#78) * Revert "Revert "Begin refactoring standard libraries (#39)" (#56)" This reverts commit 058048983c4d0509e5d522888d3d47ae49cd300e. * Update to 0.6.1904.1302-beta. (#81) * Update to 0.6.1904.1302-beta. * Removed deprecation warnings for Microsoft.Quantum.Math. * Resolved a few more deprecations. * Resolved a few more deprecation warnings. * A few more deprecation resolutions. * Removed some duplicate namespace opens. * Slight code cleanup. * Addressed feedback from @bettinaheim. * Standard.sln builds again, Standard.sln builds (#84) * Gulow/v0.6 chemistry deprecation (#82) * Update to 0.6.1904.1302-beta. * Removed deprecation warnings for Microsoft.Quantum.Math. * Resolved a few more deprecations. * Resolved a few more deprecation warnings. * A few more deprecation resolutions. * Removed some duplicate namespace opens. * Slight code cleanup. * Update test * . * Remove deprecated operations from chemistry and dependencies. * Fix comments * Update to use 0.65 syntax from latest beta. (#87) * Ported stateprep.qs to 0.65 syntax. * Fixed deprecation in test. * Updated to latest beta. * Fix mutable array issue in chemistry data model. (#88) * Explicitly call new QArray. (#89) * do not rely on collections.immutable (#93) * Continue migrating libraries to Q# 0.6 (#91) * Continue migrating to 0.65 syntax and applying style guidance. * A bit more progress normalizing private names. * Resolved more deprecated syntax, updated a name. * Resolved some more syntax warnings. * Ported more syntax and updated more names. * Resolved all remaining compile-time warnings in Standard. * Addressed all Q#-level compile-time warnings in chem. * Migrated a bit more syntax and updated to newest beta. * Moved to using intrinsic warnings. * Fixed endianness of exact QFT. * Fixed Microsoft.Quantum.Warnings. * Addressing @bettinaheim's feedback. * Removed some warnings in unit tests. * Adding DocsOutDir for single doc output location across projects. (#94) * Adding DocsOutDir for single doc output location across projects. * Begin adding more classical math functions for BigInt. (#96) * Begin adding more classical math functions for BigInt. * Addressing @beheim's feedback. * Minor fixes. * Bump to latest beta. * Fixed two minor bugs. * Fixed the type of signs. * Bump version to released packages.
2019-05-04 01:44:41 +03:00
let array = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
let evenArray = Filtered(IsEven, array);
Fact(All(IsEven, evenArray), $"the even elements of [1..10] were not correctly filtered.");
}
@Test("QuantumSimulator")
function CountOfIsEvenIsCorrect() : Unit {
let array = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
let countEvens = Count(IsEven, array);
EqualityFactI(countEvens, 5, $"the even elements of [1..10] were not correctly counted.");
Release v0.6 to master. (#98) * Begin refactoring standard libraries (#39) * Began splitting up namespaces. * Began refactoring tests. * Updated chemistry src and tests for new namespaces. * Remove unused opens. * Began renaming operations and functions. * Separated out and updated ApplyReversed*. * Updated BE ↔ LE type conversions. * Added new transformed operation fns. * Whitespace fix * Eliminated some redundant code in applyreversed * Fixed deprecation comments. * Began working on refactoring With. * Refactored With further. * More renaming for consistency with LE/BE suffix convention. * Added Zip3, Zip4 * Added shorthand for MAJ and updated some type conv. * Fixed a typo in Zip4. * Separated out and updated arithmetic measurements. * Other minor maintenance changes. * Started separating out modular arithmetic. * Began refactoring ripple-carry comparators. * Refactored integer increment operations. * Fixed some See Also blocks. * Some minor progress. * Moved new arithmetic functionality into right folders. * Renamed integer arithmetic namespaces. * Split out qecc namespace. * Added documentation file for Microsoft.Quantum.ErrorCorrection. * Progress on renaming type conversion functions. * More progress on updating type conversion names. * Split out AA namespace. * Split out oracles namespace as well. * Renamed UDTs to remove "AmpAmp" prefix. This prefix is now implied by the Microsoft.Quantum.AmplitudeAmplification namespace. * Renamed some Qecc operations/fns * Moved more conversions into Convert.qs. * Updated some deprecated syntax. * Split out M.Q.Convert. * Added missing open stmt. * Started separating out classical math. * Began separating out QCVV. * Fixing namespaces in tests. * Update to use new docgen. * Began making arrays namespace. * Updated to use new arrays and diagnostics namespaces. * Updated names for claims * Started extracting measurements from Paulis.qs. * Updated namespaces in tests as well. * Updating chemistry for most recent changes. * Added ForEach, used to simplify measurements. * Updating deprecated Q# syntax. * Minor fix for XML error. * Fixed infinite recursion in deprecation stubs. * Started trying to reduce # of warnings. * Fixed some minor build errors. * Resolved a couple TODOs. * Removed BigEndian support. * Resolved warnings due to && and ||. * Update Standard/src/Arithmetic/Shorthand.qs Co-Authored-By: cgranade <cgranade@gmail.com> * Addressing feedback. * Claim → Fact * Moved MeasureInteger back to Microsoft.Quantum.Arithmetic. * Resolved more deprecated syntax. * Removed one more LE suffix. * Addressing feedback. * Cgranade/complete 0.6 move (#57) * Revert "Begin refactoring standard libraries (#39)" (#56) As Chris pointed out, reverting these breaking changes until we have a chance to change everything... * Complete move of standard library refactoring to release branch This reverts commit 058048983c4d0509e5d522888d3d47ae49cd300e. * Explicitly qualify all names in M.Q.Ext.Math. (#74) * Explicitly qualify all names in M.Q.Ext.Math. * Fixed two missing qualified names. * Removed more occurances of M.Q.Ext.Math. * Removed Microsoft.Quantum.Extensions.Math from tests as well. * Reverted slight change to QuantumROM. * New array functions (#75) * Added new IndexRange function to eliminate `-1` in for loops. * Added some missing open statements. * New Enumerated function. * Port library and test code to new 0.6 names to reduce warning count. (#72) * Updating to use new syntax, namespace names, etc. * More primitive → intrinsic. * Updated test project to use beta version. * Updated chemistry proiects to beta. * Finding a few more calls to deprecated fns. * Cleaned up some assert and qcvv tests. * Removed uses of deprecated IntArrayFromRange * Resolved some more deprecated functions and ops. * Minor maintenance in QubitizationTests. * Bumped versions to latest beta. * Some trivial change to retrigger build. * Resolved package downgrade. * Move Microsoft.Quantum.Math.Complex UDT and resolve Microsoft.Quantum.Diagnostics deprecation stubs. (#77) * More primitive → intrinsic. * Finding a few more calls to deprecated fns. * Resolved some more deprecated functions and ops. * Minor maintenance in QubitizationTests. * Bumped versions to latest beta. * Resolved package downgrade. * Use Complex UDT at its new name. * Adapted tests. * A few more test adaptations. * Updated name of AssertQubitState to 0.6 name. * Fixes to chemistry. * Getting updates from master (#80) * Revert "Begin refactoring standard libraries (#39)" (#56) As Chris pointed out, reverting these breaking changes until we have a chance to change everything... * Missing return statement when compiling more than one Q# snippet from Python. (#60) * Fixing bug * Adding tests * Change Assembly.Version to Python.Version. (#64) * Prevent loading Q# modules when Python client is busy. (#71) * Prevent loading Q# modules when Python client is busy. * Linux build failed with some unrelated problem. Committing. * modifying contructor calls for QArray in preparation for a simulation framework change (#78) * Revert "Revert "Begin refactoring standard libraries (#39)" (#56)" This reverts commit 058048983c4d0509e5d522888d3d47ae49cd300e. * Update to 0.6.1904.1302-beta. (#81) * Update to 0.6.1904.1302-beta. * Removed deprecation warnings for Microsoft.Quantum.Math. * Resolved a few more deprecations. * Resolved a few more deprecation warnings. * A few more deprecation resolutions. * Removed some duplicate namespace opens. * Slight code cleanup. * Addressed feedback from @bettinaheim. * Standard.sln builds again, Standard.sln builds (#84) * Gulow/v0.6 chemistry deprecation (#82) * Update to 0.6.1904.1302-beta. * Removed deprecation warnings for Microsoft.Quantum.Math. * Resolved a few more deprecations. * Resolved a few more deprecation warnings. * A few more deprecation resolutions. * Removed some duplicate namespace opens. * Slight code cleanup. * Update test * . * Remove deprecated operations from chemistry and dependencies. * Fix comments * Update to use 0.65 syntax from latest beta. (#87) * Ported stateprep.qs to 0.65 syntax. * Fixed deprecation in test. * Updated to latest beta. * Fix mutable array issue in chemistry data model. (#88) * Explicitly call new QArray. (#89) * do not rely on collections.immutable (#93) * Continue migrating libraries to Q# 0.6 (#91) * Continue migrating to 0.65 syntax and applying style guidance. * A bit more progress normalizing private names. * Resolved more deprecated syntax, updated a name. * Resolved some more syntax warnings. * Ported more syntax and updated more names. * Resolved all remaining compile-time warnings in Standard. * Addressed all Q#-level compile-time warnings in chem. * Migrated a bit more syntax and updated to newest beta. * Moved to using intrinsic warnings. * Fixed endianness of exact QFT. * Fixed Microsoft.Quantum.Warnings. * Addressing @bettinaheim's feedback. * Removed some warnings in unit tests. * Adding DocsOutDir for single doc output location across projects. (#94) * Adding DocsOutDir for single doc output location across projects. * Begin adding more classical math functions for BigInt. (#96) * Begin adding more classical math functions for BigInt. * Addressing @beheim's feedback. * Minor fixes. * Bump to latest beta. * Fixed two minor bugs. * Fixed the type of signs. * Bump version to released packages.
2019-05-04 01:44:41 +03:00
}
2019-11-22 22:25:20 +03:00
@Test("QuantumSimulator")
function ReversedIsCorrect() : Unit {
Release v0.6 to master. (#98) * Begin refactoring standard libraries (#39) * Began splitting up namespaces. * Began refactoring tests. * Updated chemistry src and tests for new namespaces. * Remove unused opens. * Began renaming operations and functions. * Separated out and updated ApplyReversed*. * Updated BE ↔ LE type conversions. * Added new transformed operation fns. * Whitespace fix * Eliminated some redundant code in applyreversed * Fixed deprecation comments. * Began working on refactoring With. * Refactored With further. * More renaming for consistency with LE/BE suffix convention. * Added Zip3, Zip4 * Added shorthand for MAJ and updated some type conv. * Fixed a typo in Zip4. * Separated out and updated arithmetic measurements. * Other minor maintenance changes. * Started separating out modular arithmetic. * Began refactoring ripple-carry comparators. * Refactored integer increment operations. * Fixed some See Also blocks. * Some minor progress. * Moved new arithmetic functionality into right folders. * Renamed integer arithmetic namespaces. * Split out qecc namespace. * Added documentation file for Microsoft.Quantum.ErrorCorrection. * Progress on renaming type conversion functions. * More progress on updating type conversion names. * Split out AA namespace. * Split out oracles namespace as well. * Renamed UDTs to remove "AmpAmp" prefix. This prefix is now implied by the Microsoft.Quantum.AmplitudeAmplification namespace. * Renamed some Qecc operations/fns * Moved more conversions into Convert.qs. * Updated some deprecated syntax. * Split out M.Q.Convert. * Added missing open stmt. * Started separating out classical math. * Began separating out QCVV. * Fixing namespaces in tests. * Update to use new docgen. * Began making arrays namespace. * Updated to use new arrays and diagnostics namespaces. * Updated names for claims * Started extracting measurements from Paulis.qs. * Updated namespaces in tests as well. * Updating chemistry for most recent changes. * Added ForEach, used to simplify measurements. * Updating deprecated Q# syntax. * Minor fix for XML error. * Fixed infinite recursion in deprecation stubs. * Started trying to reduce # of warnings. * Fixed some minor build errors. * Resolved a couple TODOs. * Removed BigEndian support. * Resolved warnings due to && and ||. * Update Standard/src/Arithmetic/Shorthand.qs Co-Authored-By: cgranade <cgranade@gmail.com> * Addressing feedback. * Claim → Fact * Moved MeasureInteger back to Microsoft.Quantum.Arithmetic. * Resolved more deprecated syntax. * Removed one more LE suffix. * Addressing feedback. * Cgranade/complete 0.6 move (#57) * Revert "Begin refactoring standard libraries (#39)" (#56) As Chris pointed out, reverting these breaking changes until we have a chance to change everything... * Complete move of standard library refactoring to release branch This reverts commit 058048983c4d0509e5d522888d3d47ae49cd300e. * Explicitly qualify all names in M.Q.Ext.Math. (#74) * Explicitly qualify all names in M.Q.Ext.Math. * Fixed two missing qualified names. * Removed more occurances of M.Q.Ext.Math. * Removed Microsoft.Quantum.Extensions.Math from tests as well. * Reverted slight change to QuantumROM. * New array functions (#75) * Added new IndexRange function to eliminate `-1` in for loops. * Added some missing open statements. * New Enumerated function. * Port library and test code to new 0.6 names to reduce warning count. (#72) * Updating to use new syntax, namespace names, etc. * More primitive → intrinsic. * Updated test project to use beta version. * Updated chemistry proiects to beta. * Finding a few more calls to deprecated fns. * Cleaned up some assert and qcvv tests. * Removed uses of deprecated IntArrayFromRange * Resolved some more deprecated functions and ops. * Minor maintenance in QubitizationTests. * Bumped versions to latest beta. * Some trivial change to retrigger build. * Resolved package downgrade. * Move Microsoft.Quantum.Math.Complex UDT and resolve Microsoft.Quantum.Diagnostics deprecation stubs. (#77) * More primitive → intrinsic. * Finding a few more calls to deprecated fns. * Resolved some more deprecated functions and ops. * Minor maintenance in QubitizationTests. * Bumped versions to latest beta. * Resolved package downgrade. * Use Complex UDT at its new name. * Adapted tests. * A few more test adaptations. * Updated name of AssertQubitState to 0.6 name. * Fixes to chemistry. * Getting updates from master (#80) * Revert "Begin refactoring standard libraries (#39)" (#56) As Chris pointed out, reverting these breaking changes until we have a chance to change everything... * Missing return statement when compiling more than one Q# snippet from Python. (#60) * Fixing bug * Adding tests * Change Assembly.Version to Python.Version. (#64) * Prevent loading Q# modules when Python client is busy. (#71) * Prevent loading Q# modules when Python client is busy. * Linux build failed with some unrelated problem. Committing. * modifying contructor calls for QArray in preparation for a simulation framework change (#78) * Revert "Revert "Begin refactoring standard libraries (#39)" (#56)" This reverts commit 058048983c4d0509e5d522888d3d47ae49cd300e. * Update to 0.6.1904.1302-beta. (#81) * Update to 0.6.1904.1302-beta. * Removed deprecation warnings for Microsoft.Quantum.Math. * Resolved a few more deprecations. * Resolved a few more deprecation warnings. * A few more deprecation resolutions. * Removed some duplicate namespace opens. * Slight code cleanup. * Addressed feedback from @bettinaheim. * Standard.sln builds again, Standard.sln builds (#84) * Gulow/v0.6 chemistry deprecation (#82) * Update to 0.6.1904.1302-beta. * Removed deprecation warnings for Microsoft.Quantum.Math. * Resolved a few more deprecations. * Resolved a few more deprecation warnings. * A few more deprecation resolutions. * Removed some duplicate namespace opens. * Slight code cleanup. * Update test * . * Remove deprecated operations from chemistry and dependencies. * Fix comments * Update to use 0.65 syntax from latest beta. (#87) * Ported stateprep.qs to 0.65 syntax. * Fixed deprecation in test. * Updated to latest beta. * Fix mutable array issue in chemistry data model. (#88) * Explicitly call new QArray. (#89) * do not rely on collections.immutable (#93) * Continue migrating libraries to Q# 0.6 (#91) * Continue migrating to 0.65 syntax and applying style guidance. * A bit more progress normalizing private names. * Resolved more deprecated syntax, updated a name. * Resolved some more syntax warnings. * Ported more syntax and updated more names. * Resolved all remaining compile-time warnings in Standard. * Addressed all Q#-level compile-time warnings in chem. * Migrated a bit more syntax and updated to newest beta. * Moved to using intrinsic warnings. * Fixed endianness of exact QFT. * Fixed Microsoft.Quantum.Warnings. * Addressing @bettinaheim's feedback. * Removed some warnings in unit tests. * Adding DocsOutDir for single doc output location across projects. (#94) * Adding DocsOutDir for single doc output location across projects. * Begin adding more classical math functions for BigInt. (#96) * Begin adding more classical math functions for BigInt. * Addressing @beheim's feedback. * Minor fixes. * Bump to latest beta. * Fixed two minor bugs. * Fixed the type of signs. * Bump version to released packages.
2019-05-04 01:44:41 +03:00
let array = [1, 2, 3];
Ignore(Mapped(EqualityFactI(_, _, $"Reversed failed."), Zipped([3, 2, 1], Reversed(array))));
Release v0.6 to master. (#98) * Begin refactoring standard libraries (#39) * Began splitting up namespaces. * Began refactoring tests. * Updated chemistry src and tests for new namespaces. * Remove unused opens. * Began renaming operations and functions. * Separated out and updated ApplyReversed*. * Updated BE ↔ LE type conversions. * Added new transformed operation fns. * Whitespace fix * Eliminated some redundant code in applyreversed * Fixed deprecation comments. * Began working on refactoring With. * Refactored With further. * More renaming for consistency with LE/BE suffix convention. * Added Zip3, Zip4 * Added shorthand for MAJ and updated some type conv. * Fixed a typo in Zip4. * Separated out and updated arithmetic measurements. * Other minor maintenance changes. * Started separating out modular arithmetic. * Began refactoring ripple-carry comparators. * Refactored integer increment operations. * Fixed some See Also blocks. * Some minor progress. * Moved new arithmetic functionality into right folders. * Renamed integer arithmetic namespaces. * Split out qecc namespace. * Added documentation file for Microsoft.Quantum.ErrorCorrection. * Progress on renaming type conversion functions. * More progress on updating type conversion names. * Split out AA namespace. * Split out oracles namespace as well. * Renamed UDTs to remove "AmpAmp" prefix. This prefix is now implied by the Microsoft.Quantum.AmplitudeAmplification namespace. * Renamed some Qecc operations/fns * Moved more conversions into Convert.qs. * Updated some deprecated syntax. * Split out M.Q.Convert. * Added missing open stmt. * Started separating out classical math. * Began separating out QCVV. * Fixing namespaces in tests. * Update to use new docgen. * Began making arrays namespace. * Updated to use new arrays and diagnostics namespaces. * Updated names for claims * Started extracting measurements from Paulis.qs. * Updated namespaces in tests as well. * Updating chemistry for most recent changes. * Added ForEach, used to simplify measurements. * Updating deprecated Q# syntax. * Minor fix for XML error. * Fixed infinite recursion in deprecation stubs. * Started trying to reduce # of warnings. * Fixed some minor build errors. * Resolved a couple TODOs. * Removed BigEndian support. * Resolved warnings due to && and ||. * Update Standard/src/Arithmetic/Shorthand.qs Co-Authored-By: cgranade <cgranade@gmail.com> * Addressing feedback. * Claim → Fact * Moved MeasureInteger back to Microsoft.Quantum.Arithmetic. * Resolved more deprecated syntax. * Removed one more LE suffix. * Addressing feedback. * Cgranade/complete 0.6 move (#57) * Revert "Begin refactoring standard libraries (#39)" (#56) As Chris pointed out, reverting these breaking changes until we have a chance to change everything... * Complete move of standard library refactoring to release branch This reverts commit 058048983c4d0509e5d522888d3d47ae49cd300e. * Explicitly qualify all names in M.Q.Ext.Math. (#74) * Explicitly qualify all names in M.Q.Ext.Math. * Fixed two missing qualified names. * Removed more occurances of M.Q.Ext.Math. * Removed Microsoft.Quantum.Extensions.Math from tests as well. * Reverted slight change to QuantumROM. * New array functions (#75) * Added new IndexRange function to eliminate `-1` in for loops. * Added some missing open statements. * New Enumerated function. * Port library and test code to new 0.6 names to reduce warning count. (#72) * Updating to use new syntax, namespace names, etc. * More primitive → intrinsic. * Updated test project to use beta version. * Updated chemistry proiects to beta. * Finding a few more calls to deprecated fns. * Cleaned up some assert and qcvv tests. * Removed uses of deprecated IntArrayFromRange * Resolved some more deprecated functions and ops. * Minor maintenance in QubitizationTests. * Bumped versions to latest beta. * Some trivial change to retrigger build. * Resolved package downgrade. * Move Microsoft.Quantum.Math.Complex UDT and resolve Microsoft.Quantum.Diagnostics deprecation stubs. (#77) * More primitive → intrinsic. * Finding a few more calls to deprecated fns. * Resolved some more deprecated functions and ops. * Minor maintenance in QubitizationTests. * Bumped versions to latest beta. * Resolved package downgrade. * Use Complex UDT at its new name. * Adapted tests. * A few more test adaptations. * Updated name of AssertQubitState to 0.6 name. * Fixes to chemistry. * Getting updates from master (#80) * Revert "Begin refactoring standard libraries (#39)" (#56) As Chris pointed out, reverting these breaking changes until we have a chance to change everything... * Missing return statement when compiling more than one Q# snippet from Python. (#60) * Fixing bug * Adding tests * Change Assembly.Version to Python.Version. (#64) * Prevent loading Q# modules when Python client is busy. (#71) * Prevent loading Q# modules when Python client is busy. * Linux build failed with some unrelated problem. Committing. * modifying contructor calls for QArray in preparation for a simulation framework change (#78) * Revert "Revert "Begin refactoring standard libraries (#39)" (#56)" This reverts commit 058048983c4d0509e5d522888d3d47ae49cd300e. * Update to 0.6.1904.1302-beta. (#81) * Update to 0.6.1904.1302-beta. * Removed deprecation warnings for Microsoft.Quantum.Math. * Resolved a few more deprecations. * Resolved a few more deprecation warnings. * A few more deprecation resolutions. * Removed some duplicate namespace opens. * Slight code cleanup. * Addressed feedback from @bettinaheim. * Standard.sln builds again, Standard.sln builds (#84) * Gulow/v0.6 chemistry deprecation (#82) * Update to 0.6.1904.1302-beta. * Removed deprecation warnings for Microsoft.Quantum.Math. * Resolved a few more deprecations. * Resolved a few more deprecation warnings. * A few more deprecation resolutions. * Removed some duplicate namespace opens. * Slight code cleanup. * Update test * . * Remove deprecated operations from chemistry and dependencies. * Fix comments * Update to use 0.65 syntax from latest beta. (#87) * Ported stateprep.qs to 0.65 syntax. * Fixed deprecation in test. * Updated to latest beta. * Fix mutable array issue in chemistry data model. (#88) * Explicitly call new QArray. (#89) * do not rely on collections.immutable (#93) * Continue migrating libraries to Q# 0.6 (#91) * Continue migrating to 0.65 syntax and applying style guidance. * A bit more progress normalizing private names. * Resolved more deprecated syntax, updated a name. * Resolved some more syntax warnings. * Ported more syntax and updated more names. * Resolved all remaining compile-time warnings in Standard. * Addressed all Q#-level compile-time warnings in chem. * Migrated a bit more syntax and updated to newest beta. * Moved to using intrinsic warnings. * Fixed endianness of exact QFT. * Fixed Microsoft.Quantum.Warnings. * Addressing @bettinaheim's feedback. * Removed some warnings in unit tests. * Adding DocsOutDir for single doc output location across projects. (#94) * Adding DocsOutDir for single doc output location across projects. * Begin adding more classical math functions for BigInt. (#96) * Begin adding more classical math functions for BigInt. * Addressing @beheim's feedback. * Minor fixes. * Bump to latest beta. * Fixed two minor bugs. * Fixed the type of signs. * Bump version to released packages.
2019-05-04 01:44:41 +03:00
}
2019-11-22 22:25:20 +03:00
@Test("QuantumSimulator")
function ExcludingIsCorrect() : Unit {
Release v0.6 to master. (#98) * Begin refactoring standard libraries (#39) * Began splitting up namespaces. * Began refactoring tests. * Updated chemistry src and tests for new namespaces. * Remove unused opens. * Began renaming operations and functions. * Separated out and updated ApplyReversed*. * Updated BE ↔ LE type conversions. * Added new transformed operation fns. * Whitespace fix * Eliminated some redundant code in applyreversed * Fixed deprecation comments. * Began working on refactoring With. * Refactored With further. * More renaming for consistency with LE/BE suffix convention. * Added Zip3, Zip4 * Added shorthand for MAJ and updated some type conv. * Fixed a typo in Zip4. * Separated out and updated arithmetic measurements. * Other minor maintenance changes. * Started separating out modular arithmetic. * Began refactoring ripple-carry comparators. * Refactored integer increment operations. * Fixed some See Also blocks. * Some minor progress. * Moved new arithmetic functionality into right folders. * Renamed integer arithmetic namespaces. * Split out qecc namespace. * Added documentation file for Microsoft.Quantum.ErrorCorrection. * Progress on renaming type conversion functions. * More progress on updating type conversion names. * Split out AA namespace. * Split out oracles namespace as well. * Renamed UDTs to remove "AmpAmp" prefix. This prefix is now implied by the Microsoft.Quantum.AmplitudeAmplification namespace. * Renamed some Qecc operations/fns * Moved more conversions into Convert.qs. * Updated some deprecated syntax. * Split out M.Q.Convert. * Added missing open stmt. * Started separating out classical math. * Began separating out QCVV. * Fixing namespaces in tests. * Update to use new docgen. * Began making arrays namespace. * Updated to use new arrays and diagnostics namespaces. * Updated names for claims * Started extracting measurements from Paulis.qs. * Updated namespaces in tests as well. * Updating chemistry for most recent changes. * Added ForEach, used to simplify measurements. * Updating deprecated Q# syntax. * Minor fix for XML error. * Fixed infinite recursion in deprecation stubs. * Started trying to reduce # of warnings. * Fixed some minor build errors. * Resolved a couple TODOs. * Removed BigEndian support. * Resolved warnings due to && and ||. * Update Standard/src/Arithmetic/Shorthand.qs Co-Authored-By: cgranade <cgranade@gmail.com> * Addressing feedback. * Claim → Fact * Moved MeasureInteger back to Microsoft.Quantum.Arithmetic. * Resolved more deprecated syntax. * Removed one more LE suffix. * Addressing feedback. * Cgranade/complete 0.6 move (#57) * Revert "Begin refactoring standard libraries (#39)" (#56) As Chris pointed out, reverting these breaking changes until we have a chance to change everything... * Complete move of standard library refactoring to release branch This reverts commit 058048983c4d0509e5d522888d3d47ae49cd300e. * Explicitly qualify all names in M.Q.Ext.Math. (#74) * Explicitly qualify all names in M.Q.Ext.Math. * Fixed two missing qualified names. * Removed more occurances of M.Q.Ext.Math. * Removed Microsoft.Quantum.Extensions.Math from tests as well. * Reverted slight change to QuantumROM. * New array functions (#75) * Added new IndexRange function to eliminate `-1` in for loops. * Added some missing open statements. * New Enumerated function. * Port library and test code to new 0.6 names to reduce warning count. (#72) * Updating to use new syntax, namespace names, etc. * More primitive → intrinsic. * Updated test project to use beta version. * Updated chemistry proiects to beta. * Finding a few more calls to deprecated fns. * Cleaned up some assert and qcvv tests. * Removed uses of deprecated IntArrayFromRange * Resolved some more deprecated functions and ops. * Minor maintenance in QubitizationTests. * Bumped versions to latest beta. * Some trivial change to retrigger build. * Resolved package downgrade. * Move Microsoft.Quantum.Math.Complex UDT and resolve Microsoft.Quantum.Diagnostics deprecation stubs. (#77) * More primitive → intrinsic. * Finding a few more calls to deprecated fns. * Resolved some more deprecated functions and ops. * Minor maintenance in QubitizationTests. * Bumped versions to latest beta. * Resolved package downgrade. * Use Complex UDT at its new name. * Adapted tests. * A few more test adaptations. * Updated name of AssertQubitState to 0.6 name. * Fixes to chemistry. * Getting updates from master (#80) * Revert "Begin refactoring standard libraries (#39)" (#56) As Chris pointed out, reverting these breaking changes until we have a chance to change everything... * Missing return statement when compiling more than one Q# snippet from Python. (#60) * Fixing bug * Adding tests * Change Assembly.Version to Python.Version. (#64) * Prevent loading Q# modules when Python client is busy. (#71) * Prevent loading Q# modules when Python client is busy. * Linux build failed with some unrelated problem. Committing. * modifying contructor calls for QArray in preparation for a simulation framework change (#78) * Revert "Revert "Begin refactoring standard libraries (#39)" (#56)" This reverts commit 058048983c4d0509e5d522888d3d47ae49cd300e. * Update to 0.6.1904.1302-beta. (#81) * Update to 0.6.1904.1302-beta. * Removed deprecation warnings for Microsoft.Quantum.Math. * Resolved a few more deprecations. * Resolved a few more deprecation warnings. * A few more deprecation resolutions. * Removed some duplicate namespace opens. * Slight code cleanup. * Addressed feedback from @bettinaheim. * Standard.sln builds again, Standard.sln builds (#84) * Gulow/v0.6 chemistry deprecation (#82) * Update to 0.6.1904.1302-beta. * Removed deprecation warnings for Microsoft.Quantum.Math. * Resolved a few more deprecations. * Resolved a few more deprecation warnings. * A few more deprecation resolutions. * Removed some duplicate namespace opens. * Slight code cleanup. * Update test * . * Remove deprecated operations from chemistry and dependencies. * Fix comments * Update to use 0.65 syntax from latest beta. (#87) * Ported stateprep.qs to 0.65 syntax. * Fixed deprecation in test. * Updated to latest beta. * Fix mutable array issue in chemistry data model. (#88) * Explicitly call new QArray. (#89) * do not rely on collections.immutable (#93) * Continue migrating libraries to Q# 0.6 (#91) * Continue migrating to 0.65 syntax and applying style guidance. * A bit more progress normalizing private names. * Resolved more deprecated syntax, updated a name. * Resolved some more syntax warnings. * Ported more syntax and updated more names. * Resolved all remaining compile-time warnings in Standard. * Addressed all Q#-level compile-time warnings in chem. * Migrated a bit more syntax and updated to newest beta. * Moved to using intrinsic warnings. * Fixed endianness of exact QFT. * Fixed Microsoft.Quantum.Warnings. * Addressing @bettinaheim's feedback. * Removed some warnings in unit tests. * Adding DocsOutDir for single doc output location across projects. (#94) * Adding DocsOutDir for single doc output location across projects. * Begin adding more classical math functions for BigInt. (#96) * Begin adding more classical math functions for BigInt. * Addressing @beheim's feedback. * Minor fixes. * Bump to latest beta. * Fixed two minor bugs. * Fixed the type of signs. * Bump version to released packages.
2019-05-04 01:44:41 +03:00
let array = [10, 11, 12, 13, 14, 15];
Ignore(Mapped(EqualityFactI(_, _, $"Excluding failed."), Zipped([10, 11, 13, 14], Excluding([2, 5], array))));
Release v0.6 to master. (#98) * Begin refactoring standard libraries (#39) * Began splitting up namespaces. * Began refactoring tests. * Updated chemistry src and tests for new namespaces. * Remove unused opens. * Began renaming operations and functions. * Separated out and updated ApplyReversed*. * Updated BE ↔ LE type conversions. * Added new transformed operation fns. * Whitespace fix * Eliminated some redundant code in applyreversed * Fixed deprecation comments. * Began working on refactoring With. * Refactored With further. * More renaming for consistency with LE/BE suffix convention. * Added Zip3, Zip4 * Added shorthand for MAJ and updated some type conv. * Fixed a typo in Zip4. * Separated out and updated arithmetic measurements. * Other minor maintenance changes. * Started separating out modular arithmetic. * Began refactoring ripple-carry comparators. * Refactored integer increment operations. * Fixed some See Also blocks. * Some minor progress. * Moved new arithmetic functionality into right folders. * Renamed integer arithmetic namespaces. * Split out qecc namespace. * Added documentation file for Microsoft.Quantum.ErrorCorrection. * Progress on renaming type conversion functions. * More progress on updating type conversion names. * Split out AA namespace. * Split out oracles namespace as well. * Renamed UDTs to remove "AmpAmp" prefix. This prefix is now implied by the Microsoft.Quantum.AmplitudeAmplification namespace. * Renamed some Qecc operations/fns * Moved more conversions into Convert.qs. * Updated some deprecated syntax. * Split out M.Q.Convert. * Added missing open stmt. * Started separating out classical math. * Began separating out QCVV. * Fixing namespaces in tests. * Update to use new docgen. * Began making arrays namespace. * Updated to use new arrays and diagnostics namespaces. * Updated names for claims * Started extracting measurements from Paulis.qs. * Updated namespaces in tests as well. * Updating chemistry for most recent changes. * Added ForEach, used to simplify measurements. * Updating deprecated Q# syntax. * Minor fix for XML error. * Fixed infinite recursion in deprecation stubs. * Started trying to reduce # of warnings. * Fixed some minor build errors. * Resolved a couple TODOs. * Removed BigEndian support. * Resolved warnings due to && and ||. * Update Standard/src/Arithmetic/Shorthand.qs Co-Authored-By: cgranade <cgranade@gmail.com> * Addressing feedback. * Claim → Fact * Moved MeasureInteger back to Microsoft.Quantum.Arithmetic. * Resolved more deprecated syntax. * Removed one more LE suffix. * Addressing feedback. * Cgranade/complete 0.6 move (#57) * Revert "Begin refactoring standard libraries (#39)" (#56) As Chris pointed out, reverting these breaking changes until we have a chance to change everything... * Complete move of standard library refactoring to release branch This reverts commit 058048983c4d0509e5d522888d3d47ae49cd300e. * Explicitly qualify all names in M.Q.Ext.Math. (#74) * Explicitly qualify all names in M.Q.Ext.Math. * Fixed two missing qualified names. * Removed more occurances of M.Q.Ext.Math. * Removed Microsoft.Quantum.Extensions.Math from tests as well. * Reverted slight change to QuantumROM. * New array functions (#75) * Added new IndexRange function to eliminate `-1` in for loops. * Added some missing open statements. * New Enumerated function. * Port library and test code to new 0.6 names to reduce warning count. (#72) * Updating to use new syntax, namespace names, etc. * More primitive → intrinsic. * Updated test project to use beta version. * Updated chemistry proiects to beta. * Finding a few more calls to deprecated fns. * Cleaned up some assert and qcvv tests. * Removed uses of deprecated IntArrayFromRange * Resolved some more deprecated functions and ops. * Minor maintenance in QubitizationTests. * Bumped versions to latest beta. * Some trivial change to retrigger build. * Resolved package downgrade. * Move Microsoft.Quantum.Math.Complex UDT and resolve Microsoft.Quantum.Diagnostics deprecation stubs. (#77) * More primitive → intrinsic. * Finding a few more calls to deprecated fns. * Resolved some more deprecated functions and ops. * Minor maintenance in QubitizationTests. * Bumped versions to latest beta. * Resolved package downgrade. * Use Complex UDT at its new name. * Adapted tests. * A few more test adaptations. * Updated name of AssertQubitState to 0.6 name. * Fixes to chemistry. * Getting updates from master (#80) * Revert "Begin refactoring standard libraries (#39)" (#56) As Chris pointed out, reverting these breaking changes until we have a chance to change everything... * Missing return statement when compiling more than one Q# snippet from Python. (#60) * Fixing bug * Adding tests * Change Assembly.Version to Python.Version. (#64) * Prevent loading Q# modules when Python client is busy. (#71) * Prevent loading Q# modules when Python client is busy. * Linux build failed with some unrelated problem. Committing. * modifying contructor calls for QArray in preparation for a simulation framework change (#78) * Revert "Revert "Begin refactoring standard libraries (#39)" (#56)" This reverts commit 058048983c4d0509e5d522888d3d47ae49cd300e. * Update to 0.6.1904.1302-beta. (#81) * Update to 0.6.1904.1302-beta. * Removed deprecation warnings for Microsoft.Quantum.Math. * Resolved a few more deprecations. * Resolved a few more deprecation warnings. * A few more deprecation resolutions. * Removed some duplicate namespace opens. * Slight code cleanup. * Addressed feedback from @bettinaheim. * Standard.sln builds again, Standard.sln builds (#84) * Gulow/v0.6 chemistry deprecation (#82) * Update to 0.6.1904.1302-beta. * Removed deprecation warnings for Microsoft.Quantum.Math. * Resolved a few more deprecations. * Resolved a few more deprecation warnings. * A few more deprecation resolutions. * Removed some duplicate namespace opens. * Slight code cleanup. * Update test * . * Remove deprecated operations from chemistry and dependencies. * Fix comments * Update to use 0.65 syntax from latest beta. (#87) * Ported stateprep.qs to 0.65 syntax. * Fixed deprecation in test. * Updated to latest beta. * Fix mutable array issue in chemistry data model. (#88) * Explicitly call new QArray. (#89) * do not rely on collections.immutable (#93) * Continue migrating libraries to Q# 0.6 (#91) * Continue migrating to 0.65 syntax and applying style guidance. * A bit more progress normalizing private names. * Resolved more deprecated syntax, updated a name. * Resolved some more syntax warnings. * Ported more syntax and updated more names. * Resolved all remaining compile-time warnings in Standard. * Addressed all Q#-level compile-time warnings in chem. * Migrated a bit more syntax and updated to newest beta. * Moved to using intrinsic warnings. * Fixed endianness of exact QFT. * Fixed Microsoft.Quantum.Warnings. * Addressing @bettinaheim's feedback. * Removed some warnings in unit tests. * Adding DocsOutDir for single doc output location across projects. (#94) * Adding DocsOutDir for single doc output location across projects. * Begin adding more classical math functions for BigInt. (#96) * Begin adding more classical math functions for BigInt. * Addressing @beheim's feedback. * Minor fixes. * Bump to latest beta. * Fixed two minor bugs. * Fixed the type of signs. * Bump version to released packages.
2019-05-04 01:44:41 +03:00
}
2019-11-22 22:25:20 +03:00
@Test("QuantumSimulator")
function PaddedIsCorrect() : Unit {
let arrayTestCases = [(-5, 2, [10, 11, 12], [10, 11, 12, 2, 2]), (5, 2, [10, 11, 12], [2, 2, 10, 11, 12]), (-3, -2, [10, 11, 12], [10, 11, 12])];
2019-11-22 22:25:20 +03:00
for (nElementsTotal, defaultElement, inputArray, outputArray) in arrayTestCases {
Release v0.6 to master. (#98) * Begin refactoring standard libraries (#39) * Began splitting up namespaces. * Began refactoring tests. * Updated chemistry src and tests for new namespaces. * Remove unused opens. * Began renaming operations and functions. * Separated out and updated ApplyReversed*. * Updated BE ↔ LE type conversions. * Added new transformed operation fns. * Whitespace fix * Eliminated some redundant code in applyreversed * Fixed deprecation comments. * Began working on refactoring With. * Refactored With further. * More renaming for consistency with LE/BE suffix convention. * Added Zip3, Zip4 * Added shorthand for MAJ and updated some type conv. * Fixed a typo in Zip4. * Separated out and updated arithmetic measurements. * Other minor maintenance changes. * Started separating out modular arithmetic. * Began refactoring ripple-carry comparators. * Refactored integer increment operations. * Fixed some See Also blocks. * Some minor progress. * Moved new arithmetic functionality into right folders. * Renamed integer arithmetic namespaces. * Split out qecc namespace. * Added documentation file for Microsoft.Quantum.ErrorCorrection. * Progress on renaming type conversion functions. * More progress on updating type conversion names. * Split out AA namespace. * Split out oracles namespace as well. * Renamed UDTs to remove "AmpAmp" prefix. This prefix is now implied by the Microsoft.Quantum.AmplitudeAmplification namespace. * Renamed some Qecc operations/fns * Moved more conversions into Convert.qs. * Updated some deprecated syntax. * Split out M.Q.Convert. * Added missing open stmt. * Started separating out classical math. * Began separating out QCVV. * Fixing namespaces in tests. * Update to use new docgen. * Began making arrays namespace. * Updated to use new arrays and diagnostics namespaces. * Updated names for claims * Started extracting measurements from Paulis.qs. * Updated namespaces in tests as well. * Updating chemistry for most recent changes. * Added ForEach, used to simplify measurements. * Updating deprecated Q# syntax. * Minor fix for XML error. * Fixed infinite recursion in deprecation stubs. * Started trying to reduce # of warnings. * Fixed some minor build errors. * Resolved a couple TODOs. * Removed BigEndian support. * Resolved warnings due to && and ||. * Update Standard/src/Arithmetic/Shorthand.qs Co-Authored-By: cgranade <cgranade@gmail.com> * Addressing feedback. * Claim → Fact * Moved MeasureInteger back to Microsoft.Quantum.Arithmetic. * Resolved more deprecated syntax. * Removed one more LE suffix. * Addressing feedback. * Cgranade/complete 0.6 move (#57) * Revert "Begin refactoring standard libraries (#39)" (#56) As Chris pointed out, reverting these breaking changes until we have a chance to change everything... * Complete move of standard library refactoring to release branch This reverts commit 058048983c4d0509e5d522888d3d47ae49cd300e. * Explicitly qualify all names in M.Q.Ext.Math. (#74) * Explicitly qualify all names in M.Q.Ext.Math. * Fixed two missing qualified names. * Removed more occurances of M.Q.Ext.Math. * Removed Microsoft.Quantum.Extensions.Math from tests as well. * Reverted slight change to QuantumROM. * New array functions (#75) * Added new IndexRange function to eliminate `-1` in for loops. * Added some missing open statements. * New Enumerated function. * Port library and test code to new 0.6 names to reduce warning count. (#72) * Updating to use new syntax, namespace names, etc. * More primitive → intrinsic. * Updated test project to use beta version. * Updated chemistry proiects to beta. * Finding a few more calls to deprecated fns. * Cleaned up some assert and qcvv tests. * Removed uses of deprecated IntArrayFromRange * Resolved some more deprecated functions and ops. * Minor maintenance in QubitizationTests. * Bumped versions to latest beta. * Some trivial change to retrigger build. * Resolved package downgrade. * Move Microsoft.Quantum.Math.Complex UDT and resolve Microsoft.Quantum.Diagnostics deprecation stubs. (#77) * More primitive → intrinsic. * Finding a few more calls to deprecated fns. * Resolved some more deprecated functions and ops. * Minor maintenance in QubitizationTests. * Bumped versions to latest beta. * Resolved package downgrade. * Use Complex UDT at its new name. * Adapted tests. * A few more test adaptations. * Updated name of AssertQubitState to 0.6 name. * Fixes to chemistry. * Getting updates from master (#80) * Revert "Begin refactoring standard libraries (#39)" (#56) As Chris pointed out, reverting these breaking changes until we have a chance to change everything... * Missing return statement when compiling more than one Q# snippet from Python. (#60) * Fixing bug * Adding tests * Change Assembly.Version to Python.Version. (#64) * Prevent loading Q# modules when Python client is busy. (#71) * Prevent loading Q# modules when Python client is busy. * Linux build failed with some unrelated problem. Committing. * modifying contructor calls for QArray in preparation for a simulation framework change (#78) * Revert "Revert "Begin refactoring standard libraries (#39)" (#56)" This reverts commit 058048983c4d0509e5d522888d3d47ae49cd300e. * Update to 0.6.1904.1302-beta. (#81) * Update to 0.6.1904.1302-beta. * Removed deprecation warnings for Microsoft.Quantum.Math. * Resolved a few more deprecations. * Resolved a few more deprecation warnings. * A few more deprecation resolutions. * Removed some duplicate namespace opens. * Slight code cleanup. * Addressed feedback from @bettinaheim. * Standard.sln builds again, Standard.sln builds (#84) * Gulow/v0.6 chemistry deprecation (#82) * Update to 0.6.1904.1302-beta. * Removed deprecation warnings for Microsoft.Quantum.Math. * Resolved a few more deprecations. * Resolved a few more deprecation warnings. * A few more deprecation resolutions. * Removed some duplicate namespace opens. * Slight code cleanup. * Update test * . * Remove deprecated operations from chemistry and dependencies. * Fix comments * Update to use 0.65 syntax from latest beta. (#87) * Ported stateprep.qs to 0.65 syntax. * Fixed deprecation in test. * Updated to latest beta. * Fix mutable array issue in chemistry data model. (#88) * Explicitly call new QArray. (#89) * do not rely on collections.immutable (#93) * Continue migrating libraries to Q# 0.6 (#91) * Continue migrating to 0.65 syntax and applying style guidance. * A bit more progress normalizing private names. * Resolved more deprecated syntax, updated a name. * Resolved some more syntax warnings. * Ported more syntax and updated more names. * Resolved all remaining compile-time warnings in Standard. * Addressed all Q#-level compile-time warnings in chem. * Migrated a bit more syntax and updated to newest beta. * Moved to using intrinsic warnings. * Fixed endianness of exact QFT. * Fixed Microsoft.Quantum.Warnings. * Addressing @bettinaheim's feedback. * Removed some warnings in unit tests. * Adding DocsOutDir for single doc output location across projects. (#94) * Adding DocsOutDir for single doc output location across projects. * Begin adding more classical math functions for BigInt. (#96) * Begin adding more classical math functions for BigInt. * Addressing @beheim's feedback. * Minor fixes. * Bump to latest beta. * Fixed two minor bugs. * Fixed the type of signs. * Bump version to released packages.
2019-05-04 01:44:41 +03:00
let paddedArray = Padded(nElementsTotal, defaultElement, inputArray);
Ignore(Mapped(EqualityFactI(_, _, $"Padded failed."), Zipped(outputArray, paddedArray)));
Release v0.6 to master. (#98) * Begin refactoring standard libraries (#39) * Began splitting up namespaces. * Began refactoring tests. * Updated chemistry src and tests for new namespaces. * Remove unused opens. * Began renaming operations and functions. * Separated out and updated ApplyReversed*. * Updated BE ↔ LE type conversions. * Added new transformed operation fns. * Whitespace fix * Eliminated some redundant code in applyreversed * Fixed deprecation comments. * Began working on refactoring With. * Refactored With further. * More renaming for consistency with LE/BE suffix convention. * Added Zip3, Zip4 * Added shorthand for MAJ and updated some type conv. * Fixed a typo in Zip4. * Separated out and updated arithmetic measurements. * Other minor maintenance changes. * Started separating out modular arithmetic. * Began refactoring ripple-carry comparators. * Refactored integer increment operations. * Fixed some See Also blocks. * Some minor progress. * Moved new arithmetic functionality into right folders. * Renamed integer arithmetic namespaces. * Split out qecc namespace. * Added documentation file for Microsoft.Quantum.ErrorCorrection. * Progress on renaming type conversion functions. * More progress on updating type conversion names. * Split out AA namespace. * Split out oracles namespace as well. * Renamed UDTs to remove "AmpAmp" prefix. This prefix is now implied by the Microsoft.Quantum.AmplitudeAmplification namespace. * Renamed some Qecc operations/fns * Moved more conversions into Convert.qs. * Updated some deprecated syntax. * Split out M.Q.Convert. * Added missing open stmt. * Started separating out classical math. * Began separating out QCVV. * Fixing namespaces in tests. * Update to use new docgen. * Began making arrays namespace. * Updated to use new arrays and diagnostics namespaces. * Updated names for claims * Started extracting measurements from Paulis.qs. * Updated namespaces in tests as well. * Updating chemistry for most recent changes. * Added ForEach, used to simplify measurements. * Updating deprecated Q# syntax. * Minor fix for XML error. * Fixed infinite recursion in deprecation stubs. * Started trying to reduce # of warnings. * Fixed some minor build errors. * Resolved a couple TODOs. * Removed BigEndian support. * Resolved warnings due to && and ||. * Update Standard/src/Arithmetic/Shorthand.qs Co-Authored-By: cgranade <cgranade@gmail.com> * Addressing feedback. * Claim → Fact * Moved MeasureInteger back to Microsoft.Quantum.Arithmetic. * Resolved more deprecated syntax. * Removed one more LE suffix. * Addressing feedback. * Cgranade/complete 0.6 move (#57) * Revert "Begin refactoring standard libraries (#39)" (#56) As Chris pointed out, reverting these breaking changes until we have a chance to change everything... * Complete move of standard library refactoring to release branch This reverts commit 058048983c4d0509e5d522888d3d47ae49cd300e. * Explicitly qualify all names in M.Q.Ext.Math. (#74) * Explicitly qualify all names in M.Q.Ext.Math. * Fixed two missing qualified names. * Removed more occurances of M.Q.Ext.Math. * Removed Microsoft.Quantum.Extensions.Math from tests as well. * Reverted slight change to QuantumROM. * New array functions (#75) * Added new IndexRange function to eliminate `-1` in for loops. * Added some missing open statements. * New Enumerated function. * Port library and test code to new 0.6 names to reduce warning count. (#72) * Updating to use new syntax, namespace names, etc. * More primitive → intrinsic. * Updated test project to use beta version. * Updated chemistry proiects to beta. * Finding a few more calls to deprecated fns. * Cleaned up some assert and qcvv tests. * Removed uses of deprecated IntArrayFromRange * Resolved some more deprecated functions and ops. * Minor maintenance in QubitizationTests. * Bumped versions to latest beta. * Some trivial change to retrigger build. * Resolved package downgrade. * Move Microsoft.Quantum.Math.Complex UDT and resolve Microsoft.Quantum.Diagnostics deprecation stubs. (#77) * More primitive → intrinsic. * Finding a few more calls to deprecated fns. * Resolved some more deprecated functions and ops. * Minor maintenance in QubitizationTests. * Bumped versions to latest beta. * Resolved package downgrade. * Use Complex UDT at its new name. * Adapted tests. * A few more test adaptations. * Updated name of AssertQubitState to 0.6 name. * Fixes to chemistry. * Getting updates from master (#80) * Revert "Begin refactoring standard libraries (#39)" (#56) As Chris pointed out, reverting these breaking changes until we have a chance to change everything... * Missing return statement when compiling more than one Q# snippet from Python. (#60) * Fixing bug * Adding tests * Change Assembly.Version to Python.Version. (#64) * Prevent loading Q# modules when Python client is busy. (#71) * Prevent loading Q# modules when Python client is busy. * Linux build failed with some unrelated problem. Committing. * modifying contructor calls for QArray in preparation for a simulation framework change (#78) * Revert "Revert "Begin refactoring standard libraries (#39)" (#56)" This reverts commit 058048983c4d0509e5d522888d3d47ae49cd300e. * Update to 0.6.1904.1302-beta. (#81) * Update to 0.6.1904.1302-beta. * Removed deprecation warnings for Microsoft.Quantum.Math. * Resolved a few more deprecations. * Resolved a few more deprecation warnings. * A few more deprecation resolutions. * Removed some duplicate namespace opens. * Slight code cleanup. * Addressed feedback from @bettinaheim. * Standard.sln builds again, Standard.sln builds (#84) * Gulow/v0.6 chemistry deprecation (#82) * Update to 0.6.1904.1302-beta. * Removed deprecation warnings for Microsoft.Quantum.Math. * Resolved a few more deprecations. * Resolved a few more deprecation warnings. * A few more deprecation resolutions. * Removed some duplicate namespace opens. * Slight code cleanup. * Update test * . * Remove deprecated operations from chemistry and dependencies. * Fix comments * Update to use 0.65 syntax from latest beta. (#87) * Ported stateprep.qs to 0.65 syntax. * Fixed deprecation in test. * Updated to latest beta. * Fix mutable array issue in chemistry data model. (#88) * Explicitly call new QArray. (#89) * do not rely on collections.immutable (#93) * Continue migrating libraries to Q# 0.6 (#91) * Continue migrating to 0.65 syntax and applying style guidance. * A bit more progress normalizing private names. * Resolved more deprecated syntax, updated a name. * Resolved some more syntax warnings. * Ported more syntax and updated more names. * Resolved all remaining compile-time warnings in Standard. * Addressed all Q#-level compile-time warnings in chem. * Migrated a bit more syntax and updated to newest beta. * Moved to using intrinsic warnings. * Fixed endianness of exact QFT. * Fixed Microsoft.Quantum.Warnings. * Addressing @bettinaheim's feedback. * Removed some warnings in unit tests. * Adding DocsOutDir for single doc output location across projects. (#94) * Adding DocsOutDir for single doc output location across projects. * Begin adding more classical math functions for BigInt. (#96) * Begin adding more classical math functions for BigInt. * Addressing @beheim's feedback. * Minor fixes. * Bump to latest beta. * Fixed two minor bugs. * Fixed the type of signs. * Bump version to released packages.
2019-05-04 01:44:41 +03:00
}
}
@Test("QuantumSimulator")
function EnumeratedIsCorrect() : Unit {
Release v0.6 to master. (#98) * Begin refactoring standard libraries (#39) * Began splitting up namespaces. * Began refactoring tests. * Updated chemistry src and tests for new namespaces. * Remove unused opens. * Began renaming operations and functions. * Separated out and updated ApplyReversed*. * Updated BE ↔ LE type conversions. * Added new transformed operation fns. * Whitespace fix * Eliminated some redundant code in applyreversed * Fixed deprecation comments. * Began working on refactoring With. * Refactored With further. * More renaming for consistency with LE/BE suffix convention. * Added Zip3, Zip4 * Added shorthand for MAJ and updated some type conv. * Fixed a typo in Zip4. * Separated out and updated arithmetic measurements. * Other minor maintenance changes. * Started separating out modular arithmetic. * Began refactoring ripple-carry comparators. * Refactored integer increment operations. * Fixed some See Also blocks. * Some minor progress. * Moved new arithmetic functionality into right folders. * Renamed integer arithmetic namespaces. * Split out qecc namespace. * Added documentation file for Microsoft.Quantum.ErrorCorrection. * Progress on renaming type conversion functions. * More progress on updating type conversion names. * Split out AA namespace. * Split out oracles namespace as well. * Renamed UDTs to remove "AmpAmp" prefix. This prefix is now implied by the Microsoft.Quantum.AmplitudeAmplification namespace. * Renamed some Qecc operations/fns * Moved more conversions into Convert.qs. * Updated some deprecated syntax. * Split out M.Q.Convert. * Added missing open stmt. * Started separating out classical math. * Began separating out QCVV. * Fixing namespaces in tests. * Update to use new docgen. * Began making arrays namespace. * Updated to use new arrays and diagnostics namespaces. * Updated names for claims * Started extracting measurements from Paulis.qs. * Updated namespaces in tests as well. * Updating chemistry for most recent changes. * Added ForEach, used to simplify measurements. * Updating deprecated Q# syntax. * Minor fix for XML error. * Fixed infinite recursion in deprecation stubs. * Started trying to reduce # of warnings. * Fixed some minor build errors. * Resolved a couple TODOs. * Removed BigEndian support. * Resolved warnings due to && and ||. * Update Standard/src/Arithmetic/Shorthand.qs Co-Authored-By: cgranade <cgranade@gmail.com> * Addressing feedback. * Claim → Fact * Moved MeasureInteger back to Microsoft.Quantum.Arithmetic. * Resolved more deprecated syntax. * Removed one more LE suffix. * Addressing feedback. * Cgranade/complete 0.6 move (#57) * Revert "Begin refactoring standard libraries (#39)" (#56) As Chris pointed out, reverting these breaking changes until we have a chance to change everything... * Complete move of standard library refactoring to release branch This reverts commit 058048983c4d0509e5d522888d3d47ae49cd300e. * Explicitly qualify all names in M.Q.Ext.Math. (#74) * Explicitly qualify all names in M.Q.Ext.Math. * Fixed two missing qualified names. * Removed more occurances of M.Q.Ext.Math. * Removed Microsoft.Quantum.Extensions.Math from tests as well. * Reverted slight change to QuantumROM. * New array functions (#75) * Added new IndexRange function to eliminate `-1` in for loops. * Added some missing open statements. * New Enumerated function. * Port library and test code to new 0.6 names to reduce warning count. (#72) * Updating to use new syntax, namespace names, etc. * More primitive → intrinsic. * Updated test project to use beta version. * Updated chemistry proiects to beta. * Finding a few more calls to deprecated fns. * Cleaned up some assert and qcvv tests. * Removed uses of deprecated IntArrayFromRange * Resolved some more deprecated functions and ops. * Minor maintenance in QubitizationTests. * Bumped versions to latest beta. * Some trivial change to retrigger build. * Resolved package downgrade. * Move Microsoft.Quantum.Math.Complex UDT and resolve Microsoft.Quantum.Diagnostics deprecation stubs. (#77) * More primitive → intrinsic. * Finding a few more calls to deprecated fns. * Resolved some more deprecated functions and ops. * Minor maintenance in QubitizationTests. * Bumped versions to latest beta. * Resolved package downgrade. * Use Complex UDT at its new name. * Adapted tests. * A few more test adaptations. * Updated name of AssertQubitState to 0.6 name. * Fixes to chemistry. * Getting updates from master (#80) * Revert "Begin refactoring standard libraries (#39)" (#56) As Chris pointed out, reverting these breaking changes until we have a chance to change everything... * Missing return statement when compiling more than one Q# snippet from Python. (#60) * Fixing bug * Adding tests * Change Assembly.Version to Python.Version. (#64) * Prevent loading Q# modules when Python client is busy. (#71) * Prevent loading Q# modules when Python client is busy. * Linux build failed with some unrelated problem. Committing. * modifying contructor calls for QArray in preparation for a simulation framework change (#78) * Revert "Revert "Begin refactoring standard libraries (#39)" (#56)" This reverts commit 058048983c4d0509e5d522888d3d47ae49cd300e. * Update to 0.6.1904.1302-beta. (#81) * Update to 0.6.1904.1302-beta. * Removed deprecation warnings for Microsoft.Quantum.Math. * Resolved a few more deprecations. * Resolved a few more deprecation warnings. * A few more deprecation resolutions. * Removed some duplicate namespace opens. * Slight code cleanup. * Addressed feedback from @bettinaheim. * Standard.sln builds again, Standard.sln builds (#84) * Gulow/v0.6 chemistry deprecation (#82) * Update to 0.6.1904.1302-beta. * Removed deprecation warnings for Microsoft.Quantum.Math. * Resolved a few more deprecations. * Resolved a few more deprecation warnings. * A few more deprecation resolutions. * Removed some duplicate namespace opens. * Slight code cleanup. * Update test * . * Remove deprecated operations from chemistry and dependencies. * Fix comments * Update to use 0.65 syntax from latest beta. (#87) * Ported stateprep.qs to 0.65 syntax. * Fixed deprecation in test. * Updated to latest beta. * Fix mutable array issue in chemistry data model. (#88) * Explicitly call new QArray. (#89) * do not rely on collections.immutable (#93) * Continue migrating libraries to Q# 0.6 (#91) * Continue migrating to 0.65 syntax and applying style guidance. * A bit more progress normalizing private names. * Resolved more deprecated syntax, updated a name. * Resolved some more syntax warnings. * Ported more syntax and updated more names. * Resolved all remaining compile-time warnings in Standard. * Addressed all Q#-level compile-time warnings in chem. * Migrated a bit more syntax and updated to newest beta. * Moved to using intrinsic warnings. * Fixed endianness of exact QFT. * Fixed Microsoft.Quantum.Warnings. * Addressing @bettinaheim's feedback. * Removed some warnings in unit tests. * Adding DocsOutDir for single doc output location across projects. (#94) * Adding DocsOutDir for single doc output location across projects. * Begin adding more classical math functions for BigInt. (#96) * Begin adding more classical math functions for BigInt. * Addressing @beheim's feedback. * Minor fixes. * Bump to latest beta. * Fixed two minor bugs. * Fixed the type of signs. * Bump version to released packages.
2019-05-04 01:44:41 +03:00
let example = [37, 12];
let expected = [(0, 37), (1, 12)];
let actual = Enumerated(example);
for (actualElement, expectedElement) in Zipped(actual, expected) {
Release v0.6 to master. (#98) * Begin refactoring standard libraries (#39) * Began splitting up namespaces. * Began refactoring tests. * Updated chemistry src and tests for new namespaces. * Remove unused opens. * Began renaming operations and functions. * Separated out and updated ApplyReversed*. * Updated BE ↔ LE type conversions. * Added new transformed operation fns. * Whitespace fix * Eliminated some redundant code in applyreversed * Fixed deprecation comments. * Began working on refactoring With. * Refactored With further. * More renaming for consistency with LE/BE suffix convention. * Added Zip3, Zip4 * Added shorthand for MAJ and updated some type conv. * Fixed a typo in Zip4. * Separated out and updated arithmetic measurements. * Other minor maintenance changes. * Started separating out modular arithmetic. * Began refactoring ripple-carry comparators. * Refactored integer increment operations. * Fixed some See Also blocks. * Some minor progress. * Moved new arithmetic functionality into right folders. * Renamed integer arithmetic namespaces. * Split out qecc namespace. * Added documentation file for Microsoft.Quantum.ErrorCorrection. * Progress on renaming type conversion functions. * More progress on updating type conversion names. * Split out AA namespace. * Split out oracles namespace as well. * Renamed UDTs to remove "AmpAmp" prefix. This prefix is now implied by the Microsoft.Quantum.AmplitudeAmplification namespace. * Renamed some Qecc operations/fns * Moved more conversions into Convert.qs. * Updated some deprecated syntax. * Split out M.Q.Convert. * Added missing open stmt. * Started separating out classical math. * Began separating out QCVV. * Fixing namespaces in tests. * Update to use new docgen. * Began making arrays namespace. * Updated to use new arrays and diagnostics namespaces. * Updated names for claims * Started extracting measurements from Paulis.qs. * Updated namespaces in tests as well. * Updating chemistry for most recent changes. * Added ForEach, used to simplify measurements. * Updating deprecated Q# syntax. * Minor fix for XML error. * Fixed infinite recursion in deprecation stubs. * Started trying to reduce # of warnings. * Fixed some minor build errors. * Resolved a couple TODOs. * Removed BigEndian support. * Resolved warnings due to && and ||. * Update Standard/src/Arithmetic/Shorthand.qs Co-Authored-By: cgranade <cgranade@gmail.com> * Addressing feedback. * Claim → Fact * Moved MeasureInteger back to Microsoft.Quantum.Arithmetic. * Resolved more deprecated syntax. * Removed one more LE suffix. * Addressing feedback. * Cgranade/complete 0.6 move (#57) * Revert "Begin refactoring standard libraries (#39)" (#56) As Chris pointed out, reverting these breaking changes until we have a chance to change everything... * Complete move of standard library refactoring to release branch This reverts commit 058048983c4d0509e5d522888d3d47ae49cd300e. * Explicitly qualify all names in M.Q.Ext.Math. (#74) * Explicitly qualify all names in M.Q.Ext.Math. * Fixed two missing qualified names. * Removed more occurances of M.Q.Ext.Math. * Removed Microsoft.Quantum.Extensions.Math from tests as well. * Reverted slight change to QuantumROM. * New array functions (#75) * Added new IndexRange function to eliminate `-1` in for loops. * Added some missing open statements. * New Enumerated function. * Port library and test code to new 0.6 names to reduce warning count. (#72) * Updating to use new syntax, namespace names, etc. * More primitive → intrinsic. * Updated test project to use beta version. * Updated chemistry proiects to beta. * Finding a few more calls to deprecated fns. * Cleaned up some assert and qcvv tests. * Removed uses of deprecated IntArrayFromRange * Resolved some more deprecated functions and ops. * Minor maintenance in QubitizationTests. * Bumped versions to latest beta. * Some trivial change to retrigger build. * Resolved package downgrade. * Move Microsoft.Quantum.Math.Complex UDT and resolve Microsoft.Quantum.Diagnostics deprecation stubs. (#77) * More primitive → intrinsic. * Finding a few more calls to deprecated fns. * Resolved some more deprecated functions and ops. * Minor maintenance in QubitizationTests. * Bumped versions to latest beta. * Resolved package downgrade. * Use Complex UDT at its new name. * Adapted tests. * A few more test adaptations. * Updated name of AssertQubitState to 0.6 name. * Fixes to chemistry. * Getting updates from master (#80) * Revert "Begin refactoring standard libraries (#39)" (#56) As Chris pointed out, reverting these breaking changes until we have a chance to change everything... * Missing return statement when compiling more than one Q# snippet from Python. (#60) * Fixing bug * Adding tests * Change Assembly.Version to Python.Version. (#64) * Prevent loading Q# modules when Python client is busy. (#71) * Prevent loading Q# modules when Python client is busy. * Linux build failed with some unrelated problem. Committing. * modifying contructor calls for QArray in preparation for a simulation framework change (#78) * Revert "Revert "Begin refactoring standard libraries (#39)" (#56)" This reverts commit 058048983c4d0509e5d522888d3d47ae49cd300e. * Update to 0.6.1904.1302-beta. (#81) * Update to 0.6.1904.1302-beta. * Removed deprecation warnings for Microsoft.Quantum.Math. * Resolved a few more deprecations. * Resolved a few more deprecation warnings. * A few more deprecation resolutions. * Removed some duplicate namespace opens. * Slight code cleanup. * Addressed feedback from @bettinaheim. * Standard.sln builds again, Standard.sln builds (#84) * Gulow/v0.6 chemistry deprecation (#82) * Update to 0.6.1904.1302-beta. * Removed deprecation warnings for Microsoft.Quantum.Math. * Resolved a few more deprecations. * Resolved a few more deprecation warnings. * A few more deprecation resolutions. * Removed some duplicate namespace opens. * Slight code cleanup. * Update test * . * Remove deprecated operations from chemistry and dependencies. * Fix comments * Update to use 0.65 syntax from latest beta. (#87) * Ported stateprep.qs to 0.65 syntax. * Fixed deprecation in test. * Updated to latest beta. * Fix mutable array issue in chemistry data model. (#88) * Explicitly call new QArray. (#89) * do not rely on collections.immutable (#93) * Continue migrating libraries to Q# 0.6 (#91) * Continue migrating to 0.65 syntax and applying style guidance. * A bit more progress normalizing private names. * Resolved more deprecated syntax, updated a name. * Resolved some more syntax warnings. * Ported more syntax and updated more names. * Resolved all remaining compile-time warnings in Standard. * Addressed all Q#-level compile-time warnings in chem. * Migrated a bit more syntax and updated to newest beta. * Moved to using intrinsic warnings. * Fixed endianness of exact QFT. * Fixed Microsoft.Quantum.Warnings. * Addressing @bettinaheim's feedback. * Removed some warnings in unit tests. * Adding DocsOutDir for single doc output location across projects. (#94) * Adding DocsOutDir for single doc output location across projects. * Begin adding more classical math functions for BigInt. (#96) * Begin adding more classical math functions for BigInt. * Addressing @beheim's feedback. * Minor fixes. * Bump to latest beta. * Fixed two minor bugs. * Fixed the type of signs. * Bump version to released packages.
2019-05-04 01:44:41 +03:00
EqualityFactI(Fst(actualElement), Fst(expectedElement), "Indices did not match.");
EqualityFactI(Snd(actualElement), Snd(expectedElement), "Elements did not match.");
}
}
@Test("QuantumSimulator")
function SequenceIIsCorrect() : Unit {
let example = [(0, 3), (23, 29), (-5, -2)];
let expected = [[0, 1, 2, 3], [23, 24, 25, 26, 27, 28, 29], [-5, -4, -3, -2]];
let actual = Mapped(SequenceI, example);
for (exp, act) in Zipped(expected, actual) {
EqualityFactI(Length(exp), Length(act), "Lengths of arrays did not match.");
for (i, j) in Zipped(exp, act) {
EqualityFactI(i, j, "Elements did not match.");
}
}
}
@Test("QuantumSimulator")
function SequenceLIsCorrect() : Unit {
let example = [(0L, 3L), (23L, 29L), (-5L, -2L)];
let expected = [[0L, 1L, 2L, 3L], [23L, 24L, 25L, 26L, 27L, 28L, 29L], [-5L, -4L, -3L, -2L]];
let actual = Mapped(SequenceL, example);
for (exp, act) in Zipped(expected, actual) {
EqualityFactI(Length(exp), Length(act), "Lengths of arrays did not match.");
for (i, j) in Zipped(exp, act) {
EqualityFactL(i, j, "Elements did not match.");
}
}
}
@Test("QuantumSimulator")
function SequenceForNumbersIsCorrect() : Unit {
let example = [3, 5, 0];
let expected = [[0, 1, 2, 3], [0, 1, 2, 3, 4, 5], [0]];
let actual = Mapped(SequenceI(0, _), example);
for (exp, act) in Zipped(expected, actual) {
EqualityFactI(Length(exp), Length(act), "Lengths of arrays did not match.");
for (i, j) in Zipped(exp, act) {
EqualityFactI(i, j, "Elements did not match.");
}
}
}
@Test("QuantumSimulator")
function IsEmptyIsCorrect() : Unit {
Fact(IsEmpty<Int>([]), "Empty array marked as non-empty.");
Fact(IsEmpty<Qubit>([]), "Empty array marked as non-empty.");
Fact(IsEmpty<(Double, (Int -> String))>([]), "Empty array marked as non-empty.");
Fact(not IsEmpty([PauliX, PauliZ]), "Non-empty array marked as empty.");
Fact(not IsEmpty([""]), "Non-empty array marked as empty.");
}
@Test("QuantumSimulator")
function SwapOrderToPermuteArrayIsCorrect() : Unit {
let newOrder = [0, 4, 2, 1, 3];
let expected = [(1, 4), (1, 3)];
let actual = _SwapOrderToPermuteArray(newOrder);
EqualityFactI(Length(expected), Length(actual), "Number of swaps does not match");
for (exp, act) in Zipped(expected, actual) {
let (leftExp, rightExp) = exp;
let (leftAct, rightAct) = act;
EqualityFactI(leftExp, leftAct, "SWAP doesn't match");
EqualityFactI(rightExp, rightAct, "SWAP doesn't match");
}
}
@Test("QuantumSimulator")
function SwappedIsCorrect() : Unit {
let example = [2, 4, 6, 8, 10];
let expected = [2, 8, 6, 4, 10];
let leftIndex = 1;
let rightIndex = 3;
let newArray = Swapped(leftIndex, rightIndex, example);
EqualityFactI(Length(expected), Length(newArray), "Swapped array is a different size than original");
for (exp, act) in Zipped(expected, newArray) {
EqualityFactI(exp, act, "Elements did not match");
}
}
@Test("QuantumSimulator")
function TupleArrayAsNestedArrayIsCorrect() : Unit {
let example = [(0, 1), (2, 3), (4, 5), (6, 7)];
let expected = [[0, 1], [2, 3], [4, 5], [6, 7]];
let actual = TupleArrayAsNestedArray(example);
EqualityFactI(Length(expected), Length(actual), "Arrays are of different sizes");
for (exp, act) in Zipped(expected, actual) {
for (elementExp, elementAct) in Zipped(exp, act) {
EqualityFactI(elementExp, elementAct, "Elements did not match");
}
}
}
@Test("QuantumSimulator")
function EqualAIsCorrect() : Unit {
2020-03-03 22:01:40 +03:00
// arrays of integers
let equalArrays = EqualA(EqualI, [2, 3, 4], [2, 3, 4]);
Fact(equalArrays, "Equal arrays were not reported as equal");
2020-03-03 22:01:40 +03:00
// arrays of doubles
let differentLength = EqualA(EqualD, [2.0, 3.0, 4.0], [2.0, 3.0]);
Fact(not differentLength, "Arrays of different length were reported as equal");
2020-03-03 22:01:40 +03:00
// arrays of Results
let differentElements = EqualA(EqualR, [One, Zero], [One, One]);
Fact(not differentElements, "Arrays with different elements were reported as equal");
}
Release v0.6 to master. (#98) * Begin refactoring standard libraries (#39) * Began splitting up namespaces. * Began refactoring tests. * Updated chemistry src and tests for new namespaces. * Remove unused opens. * Began renaming operations and functions. * Separated out and updated ApplyReversed*. * Updated BE ↔ LE type conversions. * Added new transformed operation fns. * Whitespace fix * Eliminated some redundant code in applyreversed * Fixed deprecation comments. * Began working on refactoring With. * Refactored With further. * More renaming for consistency with LE/BE suffix convention. * Added Zip3, Zip4 * Added shorthand for MAJ and updated some type conv. * Fixed a typo in Zip4. * Separated out and updated arithmetic measurements. * Other minor maintenance changes. * Started separating out modular arithmetic. * Began refactoring ripple-carry comparators. * Refactored integer increment operations. * Fixed some See Also blocks. * Some minor progress. * Moved new arithmetic functionality into right folders. * Renamed integer arithmetic namespaces. * Split out qecc namespace. * Added documentation file for Microsoft.Quantum.ErrorCorrection. * Progress on renaming type conversion functions. * More progress on updating type conversion names. * Split out AA namespace. * Split out oracles namespace as well. * Renamed UDTs to remove "AmpAmp" prefix. This prefix is now implied by the Microsoft.Quantum.AmplitudeAmplification namespace. * Renamed some Qecc operations/fns * Moved more conversions into Convert.qs. * Updated some deprecated syntax. * Split out M.Q.Convert. * Added missing open stmt. * Started separating out classical math. * Began separating out QCVV. * Fixing namespaces in tests. * Update to use new docgen. * Began making arrays namespace. * Updated to use new arrays and diagnostics namespaces. * Updated names for claims * Started extracting measurements from Paulis.qs. * Updated namespaces in tests as well. * Updating chemistry for most recent changes. * Added ForEach, used to simplify measurements. * Updating deprecated Q# syntax. * Minor fix for XML error. * Fixed infinite recursion in deprecation stubs. * Started trying to reduce # of warnings. * Fixed some minor build errors. * Resolved a couple TODOs. * Removed BigEndian support. * Resolved warnings due to && and ||. * Update Standard/src/Arithmetic/Shorthand.qs Co-Authored-By: cgranade <cgranade@gmail.com> * Addressing feedback. * Claim → Fact * Moved MeasureInteger back to Microsoft.Quantum.Arithmetic. * Resolved more deprecated syntax. * Removed one more LE suffix. * Addressing feedback. * Cgranade/complete 0.6 move (#57) * Revert "Begin refactoring standard libraries (#39)" (#56) As Chris pointed out, reverting these breaking changes until we have a chance to change everything... * Complete move of standard library refactoring to release branch This reverts commit 058048983c4d0509e5d522888d3d47ae49cd300e. * Explicitly qualify all names in M.Q.Ext.Math. (#74) * Explicitly qualify all names in M.Q.Ext.Math. * Fixed two missing qualified names. * Removed more occurances of M.Q.Ext.Math. * Removed Microsoft.Quantum.Extensions.Math from tests as well. * Reverted slight change to QuantumROM. * New array functions (#75) * Added new IndexRange function to eliminate `-1` in for loops. * Added some missing open statements. * New Enumerated function. * Port library and test code to new 0.6 names to reduce warning count. (#72) * Updating to use new syntax, namespace names, etc. * More primitive → intrinsic. * Updated test project to use beta version. * Updated chemistry proiects to beta. * Finding a few more calls to deprecated fns. * Cleaned up some assert and qcvv tests. * Removed uses of deprecated IntArrayFromRange * Resolved some more deprecated functions and ops. * Minor maintenance in QubitizationTests. * Bumped versions to latest beta. * Some trivial change to retrigger build. * Resolved package downgrade. * Move Microsoft.Quantum.Math.Complex UDT and resolve Microsoft.Quantum.Diagnostics deprecation stubs. (#77) * More primitive → intrinsic. * Finding a few more calls to deprecated fns. * Resolved some more deprecated functions and ops. * Minor maintenance in QubitizationTests. * Bumped versions to latest beta. * Resolved package downgrade. * Use Complex UDT at its new name. * Adapted tests. * A few more test adaptations. * Updated name of AssertQubitState to 0.6 name. * Fixes to chemistry. * Getting updates from master (#80) * Revert "Begin refactoring standard libraries (#39)" (#56) As Chris pointed out, reverting these breaking changes until we have a chance to change everything... * Missing return statement when compiling more than one Q# snippet from Python. (#60) * Fixing bug * Adding tests * Change Assembly.Version to Python.Version. (#64) * Prevent loading Q# modules when Python client is busy. (#71) * Prevent loading Q# modules when Python client is busy. * Linux build failed with some unrelated problem. Committing. * modifying contructor calls for QArray in preparation for a simulation framework change (#78) * Revert "Revert "Begin refactoring standard libraries (#39)" (#56)" This reverts commit 058048983c4d0509e5d522888d3d47ae49cd300e. * Update to 0.6.1904.1302-beta. (#81) * Update to 0.6.1904.1302-beta. * Removed deprecation warnings for Microsoft.Quantum.Math. * Resolved a few more deprecations. * Resolved a few more deprecation warnings. * A few more deprecation resolutions. * Removed some duplicate namespace opens. * Slight code cleanup. * Addressed feedback from @bettinaheim. * Standard.sln builds again, Standard.sln builds (#84) * Gulow/v0.6 chemistry deprecation (#82) * Update to 0.6.1904.1302-beta. * Removed deprecation warnings for Microsoft.Quantum.Math. * Resolved a few more deprecations. * Resolved a few more deprecation warnings. * A few more deprecation resolutions. * Removed some duplicate namespace opens. * Slight code cleanup. * Update test * . * Remove deprecated operations from chemistry and dependencies. * Fix comments * Update to use 0.65 syntax from latest beta. (#87) * Ported stateprep.qs to 0.65 syntax. * Fixed deprecation in test. * Updated to latest beta. * Fix mutable array issue in chemistry data model. (#88) * Explicitly call new QArray. (#89) * do not rely on collections.immutable (#93) * Continue migrating libraries to Q# 0.6 (#91) * Continue migrating to 0.65 syntax and applying style guidance. * A bit more progress normalizing private names. * Resolved more deprecated syntax, updated a name. * Resolved some more syntax warnings. * Ported more syntax and updated more names. * Resolved all remaining compile-time warnings in Standard. * Addressed all Q#-level compile-time warnings in chem. * Migrated a bit more syntax and updated to newest beta. * Moved to using intrinsic warnings. * Fixed endianness of exact QFT. * Fixed Microsoft.Quantum.Warnings. * Addressing @bettinaheim's feedback. * Removed some warnings in unit tests. * Adding DocsOutDir for single doc output location across projects. (#94) * Adding DocsOutDir for single doc output location across projects. * Begin adding more classical math functions for BigInt. (#96) * Begin adding more classical math functions for BigInt. * Addressing @beheim's feedback. * Minor fixes. * Bump to latest beta. * Fixed two minor bugs. * Fixed the type of signs. * Bump version to released packages.
2019-05-04 01:44:41 +03:00
@Test("QuantumSimulator")
operation TestInterleaved() : Unit {
AllEqualityFactI(Interleaved([1, 2, 3], [-1, -2, -3]), [1, -1, 2, -2, 3, -3], "Interleaving failed");
AllEqualityFactB(Interleaved(ConstantArray(3, false), ConstantArray(2, true)), [false, true, false, true, false], "Interleaving failed");
}
@Test("QuantumSimulator")
operation TestCumulativeFolded() : Unit {
AllEqualityFactI(CumulativeFolded(PlusI, 0, SequenceI(1, 5)), [1, 3, 6, 10, 15], "CumulativeFolded failed");
}
Release v0.6 to master. (#98) * Begin refactoring standard libraries (#39) * Began splitting up namespaces. * Began refactoring tests. * Updated chemistry src and tests for new namespaces. * Remove unused opens. * Began renaming operations and functions. * Separated out and updated ApplyReversed*. * Updated BE ↔ LE type conversions. * Added new transformed operation fns. * Whitespace fix * Eliminated some redundant code in applyreversed * Fixed deprecation comments. * Began working on refactoring With. * Refactored With further. * More renaming for consistency with LE/BE suffix convention. * Added Zip3, Zip4 * Added shorthand for MAJ and updated some type conv. * Fixed a typo in Zip4. * Separated out and updated arithmetic measurements. * Other minor maintenance changes. * Started separating out modular arithmetic. * Began refactoring ripple-carry comparators. * Refactored integer increment operations. * Fixed some See Also blocks. * Some minor progress. * Moved new arithmetic functionality into right folders. * Renamed integer arithmetic namespaces. * Split out qecc namespace. * Added documentation file for Microsoft.Quantum.ErrorCorrection. * Progress on renaming type conversion functions. * More progress on updating type conversion names. * Split out AA namespace. * Split out oracles namespace as well. * Renamed UDTs to remove "AmpAmp" prefix. This prefix is now implied by the Microsoft.Quantum.AmplitudeAmplification namespace. * Renamed some Qecc operations/fns * Moved more conversions into Convert.qs. * Updated some deprecated syntax. * Split out M.Q.Convert. * Added missing open stmt. * Started separating out classical math. * Began separating out QCVV. * Fixing namespaces in tests. * Update to use new docgen. * Began making arrays namespace. * Updated to use new arrays and diagnostics namespaces. * Updated names for claims * Started extracting measurements from Paulis.qs. * Updated namespaces in tests as well. * Updating chemistry for most recent changes. * Added ForEach, used to simplify measurements. * Updating deprecated Q# syntax. * Minor fix for XML error. * Fixed infinite recursion in deprecation stubs. * Started trying to reduce # of warnings. * Fixed some minor build errors. * Resolved a couple TODOs. * Removed BigEndian support. * Resolved warnings due to && and ||. * Update Standard/src/Arithmetic/Shorthand.qs Co-Authored-By: cgranade <cgranade@gmail.com> * Addressing feedback. * Claim → Fact * Moved MeasureInteger back to Microsoft.Quantum.Arithmetic. * Resolved more deprecated syntax. * Removed one more LE suffix. * Addressing feedback. * Cgranade/complete 0.6 move (#57) * Revert "Begin refactoring standard libraries (#39)" (#56) As Chris pointed out, reverting these breaking changes until we have a chance to change everything... * Complete move of standard library refactoring to release branch This reverts commit 058048983c4d0509e5d522888d3d47ae49cd300e. * Explicitly qualify all names in M.Q.Ext.Math. (#74) * Explicitly qualify all names in M.Q.Ext.Math. * Fixed two missing qualified names. * Removed more occurances of M.Q.Ext.Math. * Removed Microsoft.Quantum.Extensions.Math from tests as well. * Reverted slight change to QuantumROM. * New array functions (#75) * Added new IndexRange function to eliminate `-1` in for loops. * Added some missing open statements. * New Enumerated function. * Port library and test code to new 0.6 names to reduce warning count. (#72) * Updating to use new syntax, namespace names, etc. * More primitive → intrinsic. * Updated test project to use beta version. * Updated chemistry proiects to beta. * Finding a few more calls to deprecated fns. * Cleaned up some assert and qcvv tests. * Removed uses of deprecated IntArrayFromRange * Resolved some more deprecated functions and ops. * Minor maintenance in QubitizationTests. * Bumped versions to latest beta. * Some trivial change to retrigger build. * Resolved package downgrade. * Move Microsoft.Quantum.Math.Complex UDT and resolve Microsoft.Quantum.Diagnostics deprecation stubs. (#77) * More primitive → intrinsic. * Finding a few more calls to deprecated fns. * Resolved some more deprecated functions and ops. * Minor maintenance in QubitizationTests. * Bumped versions to latest beta. * Resolved package downgrade. * Use Complex UDT at its new name. * Adapted tests. * A few more test adaptations. * Updated name of AssertQubitState to 0.6 name. * Fixes to chemistry. * Getting updates from master (#80) * Revert "Begin refactoring standard libraries (#39)" (#56) As Chris pointed out, reverting these breaking changes until we have a chance to change everything... * Missing return statement when compiling more than one Q# snippet from Python. (#60) * Fixing bug * Adding tests * Change Assembly.Version to Python.Version. (#64) * Prevent loading Q# modules when Python client is busy. (#71) * Prevent loading Q# modules when Python client is busy. * Linux build failed with some unrelated problem. Committing. * modifying contructor calls for QArray in preparation for a simulation framework change (#78) * Revert "Revert "Begin refactoring standard libraries (#39)" (#56)" This reverts commit 058048983c4d0509e5d522888d3d47ae49cd300e. * Update to 0.6.1904.1302-beta. (#81) * Update to 0.6.1904.1302-beta. * Removed deprecation warnings for Microsoft.Quantum.Math. * Resolved a few more deprecations. * Resolved a few more deprecation warnings. * A few more deprecation resolutions. * Removed some duplicate namespace opens. * Slight code cleanup. * Addressed feedback from @bettinaheim. * Standard.sln builds again, Standard.sln builds (#84) * Gulow/v0.6 chemistry deprecation (#82) * Update to 0.6.1904.1302-beta. * Removed deprecation warnings for Microsoft.Quantum.Math. * Resolved a few more deprecations. * Resolved a few more deprecation warnings. * A few more deprecation resolutions. * Removed some duplicate namespace opens. * Slight code cleanup. * Update test * . * Remove deprecated operations from chemistry and dependencies. * Fix comments * Update to use 0.65 syntax from latest beta. (#87) * Ported stateprep.qs to 0.65 syntax. * Fixed deprecation in test. * Updated to latest beta. * Fix mutable array issue in chemistry data model. (#88) * Explicitly call new QArray. (#89) * do not rely on collections.immutable (#93) * Continue migrating libraries to Q# 0.6 (#91) * Continue migrating to 0.65 syntax and applying style guidance. * A bit more progress normalizing private names. * Resolved more deprecated syntax, updated a name. * Resolved some more syntax warnings. * Ported more syntax and updated more names. * Resolved all remaining compile-time warnings in Standard. * Addressed all Q#-level compile-time warnings in chem. * Migrated a bit more syntax and updated to newest beta. * Moved to using intrinsic warnings. * Fixed endianness of exact QFT. * Fixed Microsoft.Quantum.Warnings. * Addressing @bettinaheim's feedback. * Removed some warnings in unit tests. * Adding DocsOutDir for single doc output location across projects. (#94) * Adding DocsOutDir for single doc output location across projects. * Begin adding more classical math functions for BigInt. (#96) * Begin adding more classical math functions for BigInt. * Addressing @beheim's feedback. * Minor fixes. * Bump to latest beta. * Fixed two minor bugs. * Fixed the type of signs. * Bump version to released packages.
2019-05-04 01:44:41 +03:00
@Test("QuantumSimulator")
operation TestTransposed() : Unit {
for (actual, expected) in Zipped(Transposed([[1, 2, 3], [4, 5, 6]]), [[1, 4], [2, 5], [3, 6]]) {
AllEqualityFactI(actual, expected, "Transposed failed");
}
}
@Test("QuantumSimulator")
operation TestColumnAt() : Unit {
let matrix = [[1, 2, 3], [4, 5, 6], [7, 8, 9]];
AllEqualityFactI(ColumnAt(0, matrix), [1, 4, 7], "ColumnAt failed");
AllEqualityFactI(ColumnAt(1, matrix), [2, 5, 8], "ColumnAt failed");
AllEqualityFactI(ColumnAt(2, matrix), [3, 6, 9], "ColumnAt failed");
}
@Test("QuantumSimulator")
operation TestElementAt() : Unit {
let lucas = [2, 1, 3, 4, 7, 11, 18, 29, 47, 76];
let prime = [2, 3, 5, 7, 11, 13, 17, 19, 23, 29];
let fibonacci = [0, 1, 1, 2, 3, 5, 8, 13, 21, 34];
let catalan = [1, 1, 2, 5, 14, 42, 132, 429, 1430, 4862];
let famous2 = Mapped(ElementAt(2, _), [lucas, prime, fibonacci, catalan]);
AllEqualityFactI(famous2, [3, 5, 1, 2], "ElementAt failed");
}
@Test("QuantumSimulator")
operation TestElementsAt() : Unit {
let lucas = [2, 1, 3, 4, 7, 11, 18, 29, 47, 76];
let prime = [2, 3, 5, 7, 11, 13, 17, 19, 23, 29];
let fibonacci = [0, 1, 1, 2, 3, 5, 8, 13, 21, 34];
let catalan = [1, 1, 2, 5, 14, 42, 132, 429, 1430, 4862];
let famousOdd = Mapped(ElementsAt<Int>(0..2..9, _), [lucas, prime, fibonacci, catalan]);
for (actual, expected) in Zipped(famousOdd, [[2, 3, 7, 18, 47], [2, 5, 11, 17, 23], [0, 1, 3, 8, 21], [1, 2, 14, 132, 1430]]) {
AllEqualityFactI(actual, expected, "ElementsAt failed");
}
}
@Test("QuantumSimulator")
operation TestDiagonal() : Unit {
AllEqualityFactI(Diagonal([[1, 2, 3], [4, 5, 6], [7, 8, 9]]), [1, 5, 9], "Diagonal failed");
AllEqualityFactI(Diagonal([[1, 2, 3], [4, 5, 6]]), [1, 5], "Diagonal failed");
AllEqualityFactI(Diagonal([[1, 2], [4, 5], [7, 8]]), [1, 5], "Diagonal failed");
}
@Test("QuantumSimulator")
operation TestWindows() : Unit {
let EqualIntA = EqualA(EqualI, _, _);
let EqualIntAA = EqualA(EqualIntA, _, _);
Fact(EqualIntAA(Windows(-1, [1, 2, 3]), []), "unexpected windows");
Fact(EqualIntAA(Windows(0, [1, 2, 3]), []), "unexpected windows");
Fact(EqualIntAA(Windows(1, [1, 2, 3]), [[1], [2], [3]]), "unexpected windows");
Fact(EqualIntAA(Windows(2, [1, 2, 3]), [[1, 2], [2, 3]]), "unexpected windows");
Fact(EqualIntAA(Windows(3, [1, 2, 3]), [[1, 2, 3]]), "unexpected windows");
Fact(EqualIntAA(Windows(4, [1, 2, 3]), []), "unexpected windows");
}
@Test("QuantumSimulator")
operation TestPrefixes() : Unit {
let array = [0, 1, 1, 2, 3, 5];
let prefixes = Prefixes(array);
EqualityFactI(Length(prefixes), Length(array), "unexpected length for prefixes");
AllEqualityFactI(prefixes[0], [0], "unexpected prefix");
AllEqualityFactI(prefixes[1], [0, 1], "unexpected prefix");
AllEqualityFactI(prefixes[2], [0, 1, 1], "unexpected prefix");
AllEqualityFactI(prefixes[3], [0, 1, 1, 2], "unexpected prefix");
AllEqualityFactI(prefixes[4], [0, 1, 1, 2, 3], "unexpected prefix");
AllEqualityFactI(prefixes[5], [0, 1, 1, 2, 3, 5], "unexpected prefix");
}
@Test("QuantumSimulator")
operation TestSuccessfulRectangularFact() : Unit {
RectangularArrayFact([[1, 2], [3, 4]], "Array is not rectangular");
RectangularArrayFact([[1, 2, 3], [4, 5, 6]], "Array is not rectangular");
}
operation RectangularFactTestShouldFail() : Unit {
RectangularArrayFact([[1, 2], [3, 4, 5]], "Array is not rectangular");
}
@Test("QuantumSimulator")
operation TestSuccessfulSquareFact() : Unit {
SquareArrayFact([[1, 2], [3, 4]], "Array is not a square");
}
operation SquareFact1TestShouldFail() : Unit {
SquareArrayFact([[1, 2, 3], [4, 5, 6]], "Array is not a square");
}
operation SquareFact2TestShouldFail() : Unit {
SquareArrayFact([[1, 2], [3, 4, 5]], "Array is not a square");
}
}