Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
open System | |
open DiffSharp.AD.Float64 | |
open Microsoft.Quantum.Simulation; | |
open Microsoft.Quantum.Simulation.Core; | |
open Microsoft.Quantum.Simulation.Common; | |
open Microsoft.Quantum.Simulation.Simulators; | |
open DiffSharp.Quantum.AD.Float64 | |
[<EntryPoint>] | |
let main argv = |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
TraceOp = | |
// Scalar-valued operations | |
| Add_D_D of D * D | |
| Add_D_DCons of D | |
... | |
| VarCirq_DV of DV * (DV->DV) | |
let rec resetRec (ds:dobj list) = | |
match ds with |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module DiffSharp.Quantum.AD.Float64 | |
open DiffSharp.AD.Float64 | |
open Microsoft.Quantum.Simulation.Core; | |
let inline sparseArray (i:int) (n:int) (el:D)= | |
DV.init n (fun j -> if j <> i then D 0.0 else el) | |
let inline q_grad (f:DV->D) (args:DV) : DV= | |
let n =args.Length |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace Quantum.VariationalQuantumCircuits | |
{ | |
open Microsoft.Quantum.Characterization; | |
open Microsoft.Quantum.Intrinsic; | |
open Microsoft.Quantum.Canon; | |
operation Expval(cirq:((Double[],Qubit[])=>Unit is Adj),args:Double[],measurement:Pauli[], nQubits:Int) : Double { | |
let rs= EstimateFrequencyA(cirq(args,_),Measure(measurement,_),nQubits,1000); | |
return 2.*rs-1.; | |
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
NewerOlder