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
using System; | |
using Microsoft.Quantum.Simulation.Core; | |
using Microsoft.Quantum.Simulation.Simulators; | |
using System.Collections.Generic; | |
namespace Quantum.Search | |
{ | |
class Driver | |
{ | |
static void Main(string[] args) |
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
using System; | |
using Microsoft.Quantum.Simulation.Core; | |
using Microsoft.Quantum.Simulation.Simulators; | |
using System.Collections.Generic; | |
namespace Quantum.Search | |
{ | |
class Driver | |
{ | |
static void Main(string[] args) |
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
using System; | |
using Microsoft.Quantum.Simulation.Core; | |
using Microsoft.Quantum.Simulation.Simulators; | |
namespace Quantum.Sample | |
{ | |
class Driver | |
{ | |
static void Main(string[] args) |
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.Sample | |
{ | |
open Microsoft.Quantum.Primitive; | |
open Microsoft.Quantum.Canon; | |
open Microsoft.Quantum.Extensions.Convert; | |
open Microsoft.Quantum.Extensions.Math; | |
operation SprinklerAnc (queryRegister: Qubit[], target : Qubit,ancilla: Qubit[]) : Unit { | |
body (...) { | |
X(queryRegister[2]); |
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
:- use_module(library(tabling)). | |
:- table eruption(prob_sum),sudden_energy_release/0,fault_rupture(_,prob_sum). | |
eruption(P) :- | |
sudden_energy_release, | |
fault_rupture(_,P0), | |
P is P0*0.6. | |
% If there is a sudden energy release under the island and there is a fault | |
% rupture, then there can be an eruption of the volcano on the island with | |
% probability 0.6 |
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
:- use_module(library(tabling)). | |
:- table sneezing(_,prob_sum),flu(_,prob_sum),hay_fever(_,prob_sum). | |
sneezing(X,P) :- flu(X,P0), P is P0*0.3. | |
% if X has the flu, there is a probability of 0.3 that he sneezes | |
sneezing(X,P) :- hay_fever(X,P0), P is P0*0.2. | |
% if X has hay fever, there is a probability of 0.2 that he sneezes | |
flu(bob,0.2). |