Skip to content

Commit 6afd08c

Browse files
committed
Release 0.3.1810
1 parent 5dc1838 commit 6afd08c

File tree

419 files changed

+2131471
-19172
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

419 files changed

+2131471
-19172
lines changed

.gitattributes

+2-56
Original file line numberDiff line numberDiff line change
@@ -5,60 +5,6 @@
55
*.sh text eol=lf
66

77
###############################################################################
8-
# Set default behavior for command prompt diff.
9-
#
10-
# This is need for earlier builds of msysgit that does not have it on by
11-
# default for csharp files.
12-
# Note: This is only used by command line
8+
# diff behavior for some non-binary formats
139
###############################################################################
14-
#*.cs diff=csharp
15-
16-
###############################################################################
17-
# Set the merge driver for project and solution files
18-
#
19-
# Merging from the command prompt will add diff markers to the files if there
20-
# are conflicts (Merging from VS is not affected by the settings below, in VS
21-
# the diff markers are never inserted). Diff markers may cause the following
22-
# file extensions to fail to load in VS. An alternative would be to treat
23-
# these files as binary and thus will always conflict and require user
24-
# intervention with every merge. To do so, just uncomment the entries below
25-
###############################################################################
26-
#*.sln merge=binary
27-
#*.csproj merge=binary
28-
#*.vbproj merge=binary
29-
#*.vcxproj merge=binary
30-
#*.vcproj merge=binary
31-
#*.dbproj merge=binary
32-
#*.fsproj merge=binary
33-
#*.lsproj merge=binary
34-
#*.wixproj merge=binary
35-
#*.modelproj merge=binary
36-
#*.sqlproj merge=binary
37-
#*.wwaproj merge=binary
38-
39-
###############################################################################
40-
# behavior for image files
41-
#
42-
# image files are treated as binary by default.
43-
###############################################################################
44-
#*.jpg binary
45-
#*.png binary
46-
#*.gif binary
47-
48-
###############################################################################
49-
# diff behavior for common document formats
50-
#
51-
# Convert binary document formats to text before diffing them. This feature
52-
# is only available from the command line. Turn it on by uncommenting the
53-
# entries below.
54-
###############################################################################
55-
#*.doc diff=astextplain
56-
#*.DOC diff=astextplain
57-
#*.docx diff=astextplain
58-
#*.DOCX diff=astextplain
59-
#*.dot diff=astextplain
60-
#*.DOT diff=astextplain
61-
#*.pdf diff=astextplain
62-
#*.PDF diff=astextplain
63-
#*.rtf diff=astextplain
64-
#*.RTF diff=astextplain
10+
*.md diff=text

.gitignore

-10
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,6 @@ packages/
1515
*.exe
1616
*.chm
1717

18-
# These files are generated by bootstrap from a .v.template (version template).
19-
# Any changes must be done to the corresponding the .v.template file directly
20-
Microsoft.Quantum.Canon/Microsoft.Quantum.Canon.nuspec
21-
22-
# Python interop build outputs:
23-
Interoperability/python/build
24-
Interoperability/python/dist
25-
Interoperability/python/qsharp.egg-info
26-
Interoperability/python/qsharp/version.py
27-
2818
# test outputs
2919
TestResults/
3020
*.qxe

.travis.yml

+1-3
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,4 @@ matrix:
2323
- g++-4.9
2424

2525
script:
26-
- dotnet build QsharpLibraries.sln
27-
- dotnet test Samples/UnitTesting
28-
- travis_wait 30 dotnet test LibraryTests
26+
- dotnet build QSharpSamples.sln

Build/step-build-samples.yml

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
##
2+
# Builds, tests & package all libraries.
3+
##
4+
5+
steps:
6+
##
7+
# Build
8+
##
9+
- task: DotNetCoreCLI@2
10+
displayName: 'Build Samples'
11+
inputs:
12+
projects: '$(SamplesRootFolder)/**/*.sln'
13+
arguments: '-c $(BuildConfiguration) -v n'
14+
15+
16+
- task: DotNetCoreCLI@2
17+
displayName: 'Test Samples'
18+
inputs:
19+
command: test
20+
projects: |
21+
$(SamplesRootFolder)/Samples/src/UnitTesting
22+
$(SamplesRootFolder)/Samples/tests/SampleTests
23+
arguments: '-c $(BuildConfiguration) -v n'
24+
25+
##
26+
# Check that all integral data sets are valid.
27+
##
28+
- task: CondaEnvironment@1
29+
inputs:
30+
createCustomEnvironment: true
31+
environmentName: validator
32+
packageSpecs: 'python=3 ruamel_yaml jsonschema click'
33+
displayName: 'Install validator environment.'
34+
35+
- script: python validator.py ../IntegralData/**/*.yaml broombridge-0.1.schema.json
36+
workingDirectory: $(SamplesRootFolder)/Chemistry/Schema/
37+
displayName: 'Validate all Broombridge data files.'

Build/step-wrap-up.yml

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
##
2+
# Wrap-up: copy files to artifacts directory and publish
3+
##
4+
5+
steps:
6+
- task: PublishSymbols@1
7+
displayName: 'Publish symbols path: '
8+
9+
10+
- task: CopyFiles@2
11+
displayName: 'Copy Files to: $(build.artifactstagingdirectory)'
12+
inputs:
13+
SourceFolder: '$(build.sourcesdirectory)'
14+
Contents: |
15+
**\bin\$(BuildConfiguration)\**
16+
TargetFolder: '$(build.artifactstagingdirectory)'
17+
condition: succeededOrFailed()
18+
19+
20+
21+
- task: PublishBuildArtifacts@1
22+
displayName: 'Publish Artifact: drop'
23+
inputs:
24+
PathtoPublish: '$(build.artifactstagingdirectory)'
25+
condition: succeededOrFailed()
26+
27+
28+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<OutputType>Exe</OutputType>
5+
<TargetFramework>netcoreapp2.0</TargetFramework>
6+
</PropertyGroup>
7+
8+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
9+
<PlatformTarget>x64</PlatformTarget>
10+
</PropertyGroup>
11+
12+
<ItemGroup>
13+
<PackageReference Include="Microsoft.Extensions.Logging" Version="2.1.1" />
14+
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="2.1.1" />
15+
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="2.1.1" />
16+
<PackageReference Include="Microsoft.Quantum.Chemistry" Version="0.3.1810.2508-preview" />
17+
<PackageReference Include="Microsoft.Quantum.Development.Kit" Version="0.3.1810.2508-preview" />
18+
</ItemGroup>
19+
20+
</Project>
+68
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
// Copyright (c) Microsoft Corporation. All rights reserved.
2+
// Licensed under the MIT License.
3+
4+
using Microsoft.Extensions.Logging;
5+
using Microsoft.Quantum.Chemistry;
6+
using System.Linq;
7+
8+
// This loads a Hamiltonian from file and computes some of its features
9+
// - L1-Norm of terms
10+
11+
namespace Microsoft.Quantum.Chemistry.Sample
12+
{
13+
14+
class Program
15+
{
16+
17+
static void Main(string[] args)
18+
{
19+
var logger = Logging.LoggerFactory.CreateLogger<Program>();
20+
21+
// Directory containing integral data generated by Microsoft.
22+
//Example Liquid data format files
23+
/*
24+
"h2_sto3g_4.dat" // 4 SO
25+
"B_sto6g.dat" // 10 SO
26+
"Be_sto6g_10.dat" // 10 SO
27+
"h2o_sto6g_14.dat" // 14 SO
28+
"h2s_sto6g_22.dat" // 22 SO
29+
"co2_sto3g_30.dat" // 30 SO
30+
"co2_p321_54.dat" // 54 SO
31+
"fe2s2_sto3g.dat" // 110 SO
32+
"nitrogenase_tzvp_54.dat" // 108 SO
33+
*/
34+
35+
string LiquidRoot = @"..\IntegralData\Liquid\";
36+
string LiquidFilename = "fe2s2_sto3g.dat";
37+
// Number of electrons. This must be specified for the liquid format.
38+
var LiquidElectrons = 2;
39+
40+
// Directory containing integral data in YAML format.
41+
string YAMLRoot = @"..\IntegralData\YAML\";
42+
string YAMLFilename = "lih_sto-3g_0.800_int.yaml";
43+
44+
// For loading data in the format consumed by Liquid.
45+
logger.LogInformation($"Processing {LiquidFilename}");
46+
var generalHamiltonian = FermionHamiltonian.LoadFromLiquid($@"{LiquidRoot}\{LiquidFilename}").Single();
47+
generalHamiltonian.NElectrons = LiquidElectrons;
48+
49+
// For loading data in the YAML format.
50+
//var generalHamiltonian = FermionHamiltonian.LoadFromYAML($@"{YAMLRoot}\{YAMLFilename}").Single();
51+
52+
// Read Hamiltonian terms from file.
53+
54+
logger.LogInformation("End read file. Computing one-norms.");
55+
foreach (var oneNormPair in generalHamiltonian.ComputeOneNorms())
56+
{
57+
logger.LogInformation($"One-norm for term type {oneNormPair.Key}: {oneNormPair.Value}");
58+
}
59+
logger.LogInformation("Computed one-norm.");
60+
61+
if (System.Diagnostics.Debugger.IsAttached)
62+
{
63+
System.Console.ReadLine();
64+
}
65+
}
66+
}
67+
}
68+

0 commit comments

Comments
 (0)