QuantumLibraries/Build/pack.ps1

78 строки
2.1 KiB
PowerShell
Исходник Обычный вид История

# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
$ErrorActionPreference = 'Stop'
& "$PSScriptRoot/set-env.ps1"
$all_ok = $True
function Pack-One() {
Param($project)
dotnet pack (Join-Path $PSScriptRoot $project) `
--no-build `
-c $Env:BUILD_CONFIGURATION `
-v $Env:BUILD_VERBOSITY `
-o $Env:NUGET_OUTDIR `
Simplify gradient estimation and classifier structure generation (#200) * Clarify the restriction on the number of bits for IntAsBoolArray (#171) * Clarify the restriction on the number of bits for IntAsBoolArray This should fix #166 by providing a more specific error message. * Update Standard/src/Convert/Convert.qs Co-Authored-By: Chris Granade <chgranad@microsoft.com> * Allow to have bits = 0 Looks like our tests assume that number = 0 with bits = 0 is a valid scenario; updating the change to account for that * Package updates (#188) * Quantum AND gates (a.k.a. CCNOT with constant target) (#186) * Two AND gate implementations. * Added test case. * Formatting. * Code formatting. * Update Standard/src/Canon/And.qs Co-Authored-By: Chris Granade <chgranad@microsoft.com> * Assertion for 0-target. * Added DOI to references. * Named application for CCNOTop. * Rename operations. * Add Test attribute. * Add links to arXiv. * Rename operations. * Better assertion for 0-target. * Fix bug in LowDepthAnd. * Docs. * Doc string convention. * Controlled variant for `ApplyAnd`. * Controlled AndLowDepth. * Adjoint Controlled LowDepthAnd. * References. * Simplify code. * Apply suggestions from code review Co-Authored-By: Chris Granade <chgranad@microsoft.com> * Integrate comment. * Removed comment ref to IncrementByIntegerPhaseLE (#189) There appears to be no function IncrementByIntegerPhaseLE, and I guess it is covered by ApplyLEOperationOnPhaseLE. Co-authored-by: Chris Granade <cgranade@gmail.com> * New Hadamard and SWAP test operations. (#196) * First work on Hadamard and SWAP test operations. * (c) header and typo fix. * Fixed typo with placement of phase shift. * Put public operations above private. * Added tests for new operations. * Added API documentation comments. * Newline at end of file. * Refactor AA namespace to use Q# style guide (#197) * Began simplifying AA interface. * Expose traditional AA as new public operation. * Removed rest of "AmpAmp" prefix. * Resolve deprecation warning. * Begin moving classifier structure creation to Q#. * Moving example datasets into new namespace. * Fix datasets used in layered structure demo. * Fixed bug with cyclic entangling layer. * Use new Hadamard test operation to simplify grad est. * Simplify input encoder logic. * Removed layer construction methods moved out to Q#. * Revised name of approximate input encoder. * Removed unused interop library. * Update pack script for new layout. * Addressing feedback. Co-authored-by: Mariia Mykhailova <michaylova@gmail.com> Co-authored-by: bettinaheim <34236215+bettinaheim@users.noreply.github.com> Co-authored-by: Mathias Soeken <mathias.soeken@gmail.com> Co-authored-by: numpde <21158052+numpde@users.noreply.github.com>
2020-01-13 22:39:44 +03:00
/property:PackageVersion=$Env:NUGET_VERSION
if ($LastExitCode -ne 0) {
Write-Host "##vso[task.logissue type=error;]Failed to pack $project."
$script:all_ok = $False
}
}
function Pack-Wheel() {
param(
[string] $Path
);
$result = 0
Push-Location (Join-Path $PSScriptRoot $Path)
python setup.py bdist_wheel sdist --formats=gztar
if ($LastExitCode -ne 0) {
Write-Host "##vso[task.logissue type=error;]Failed to build $Path."
$script:all_ok = $False
} else {
Copy-Item "dist/*.whl" $Env:PYTHON_OUTDIR
Copy-Item "dist/*.tar.gz" $Env:PYTHON_OUTDIR
}
Pop-Location
}
Write-Host "##[info]Pack Standard library"
Pack-One '../Standard/src/Standard.csproj'
Write-Host "##[info]Pack Chemistry library"
Pack-One '../Chemistry/src/Runtime/Runtime.csproj'
Pack-One '../Chemistry/src/DataModel/DataModel.csproj'
Pack-One '../Chemistry/src/Metapackage/Metapackage.csproj'
Write-Host "##[info]Pack QML library"
Simplify gradient estimation and classifier structure generation (#200) * Clarify the restriction on the number of bits for IntAsBoolArray (#171) * Clarify the restriction on the number of bits for IntAsBoolArray This should fix #166 by providing a more specific error message. * Update Standard/src/Convert/Convert.qs Co-Authored-By: Chris Granade <chgranad@microsoft.com> * Allow to have bits = 0 Looks like our tests assume that number = 0 with bits = 0 is a valid scenario; updating the change to account for that * Package updates (#188) * Quantum AND gates (a.k.a. CCNOT with constant target) (#186) * Two AND gate implementations. * Added test case. * Formatting. * Code formatting. * Update Standard/src/Canon/And.qs Co-Authored-By: Chris Granade <chgranad@microsoft.com> * Assertion for 0-target. * Added DOI to references. * Named application for CCNOTop. * Rename operations. * Add Test attribute. * Add links to arXiv. * Rename operations. * Better assertion for 0-target. * Fix bug in LowDepthAnd. * Docs. * Doc string convention. * Controlled variant for `ApplyAnd`. * Controlled AndLowDepth. * Adjoint Controlled LowDepthAnd. * References. * Simplify code. * Apply suggestions from code review Co-Authored-By: Chris Granade <chgranad@microsoft.com> * Integrate comment. * Removed comment ref to IncrementByIntegerPhaseLE (#189) There appears to be no function IncrementByIntegerPhaseLE, and I guess it is covered by ApplyLEOperationOnPhaseLE. Co-authored-by: Chris Granade <cgranade@gmail.com> * New Hadamard and SWAP test operations. (#196) * First work on Hadamard and SWAP test operations. * (c) header and typo fix. * Fixed typo with placement of phase shift. * Put public operations above private. * Added tests for new operations. * Added API documentation comments. * Newline at end of file. * Refactor AA namespace to use Q# style guide (#197) * Began simplifying AA interface. * Expose traditional AA as new public operation. * Removed rest of "AmpAmp" prefix. * Resolve deprecation warning. * Begin moving classifier structure creation to Q#. * Moving example datasets into new namespace. * Fix datasets used in layered structure demo. * Fixed bug with cyclic entangling layer. * Use new Hadamard test operation to simplify grad est. * Simplify input encoder logic. * Removed layer construction methods moved out to Q#. * Revised name of approximate input encoder. * Removed unused interop library. * Update pack script for new layout. * Addressing feedback. Co-authored-by: Mariia Mykhailova <michaylova@gmail.com> Co-authored-by: bettinaheim <34236215+bettinaheim@users.noreply.github.com> Co-authored-by: Mathias Soeken <mathias.soeken@gmail.com> Co-authored-by: numpde <21158052+numpde@users.noreply.github.com>
2020-01-13 22:39:44 +03:00
Pack-One '../MachineLearning/src/MachineLearning.csproj'
Write-Host "##[info]Pack Numerics library"
Pack-One '../Numerics/src/Numerics.csproj'
Write-Host "##[info]Pack chemistry magics library"
Pack-One '../Chemistry/src/Jupyter/Jupyter.csproj'
2020-06-24 03:09:17 +03:00
Write-Host "##[info]Pack chemistry tool"
Pack-One '../Chemistry/src/Tools/Tools.csproj'
if ($Env:ENABLE_PYTHON -eq "false") {
Write-Host "##vso[task.logissue type=warning;]Skipping Creating Python packages. Env:ENABLE_PYTHON was set to 'false'."
} else {
Write-Host "##[info]Packing Python wheel..."
python --version
Pack-Wheel '../Python/qsharp-chemistry'
Pack-Wheel '../Python/qsharp'
}
if (-not $all_ok) {
throw "At least one test failed execution. Check the logs."
}