├── .gitignore ├── 1-Basic_Quantum_Concepts ├── 1-States.ipynb ├── 2-Gates.ipynb ├── 3-Entanglement.ipynb ├── 4-Teleportation.ipynb ├── 5-No-Cloning_Theorem.ipynb ├── 6-CHSH_Game.ipynb └── media │ ├── Bell_state_circuit.png │ ├── Bell_state_table.png │ ├── CHSH_game.png │ ├── CHSH_game_quirk.png │ ├── CNOTgate_excercise.png │ ├── CNOTgate_excercise2.png │ ├── CNOTgate_excercise3.png │ ├── Kronecker_product.png │ ├── applyingrandomizingmatrix.png │ ├── blochspherearbitrary.png │ ├── blochspherehadamard.png │ ├── blochspherepauli.png │ ├── blochsphereplusminus.png │ ├── blochspherezeroone.png │ ├── circuitRepresentationhadamard.png │ ├── circuitRepresentationqubit.png │ ├── circuitrepresentationcnot.png │ ├── circuitrepresentationpauli.png │ ├── complex_numbers.png │ ├── constructiveinterference.png │ ├── cover small crop.png │ ├── cover small.png │ ├── dirac_notation.png │ ├── entanglement.png │ ├── faster_than_light.png │ ├── gate.png │ ├── interference.png │ ├── measurement.png │ ├── measurement_exercise.png │ ├── mistake.png │ ├── multiple_qubits.png │ ├── multiplyingamplitudes.png │ ├── probabilitytrees.png │ ├── quirk1.png │ ├── quirk2.png │ ├── quirk3.png │ ├── spinning_coin.png │ ├── states.png │ ├── superdense.png │ ├── superdense_wiki.png │ ├── superposition.png │ ├── teleportation.png │ ├── teleportation_circuit.png │ ├── teleportation_circuit1.png │ ├── teleportation_circuit2.png │ ├── teleportation_circuit3.png │ ├── teleportation_circuit4.png │ ├── teleportation_quirk.png │ ├── teleportation_screen1.png │ ├── teleportation_screen2.png │ ├── teleportation_table.png │ └── wavefunction.png ├── 2-Quantum_Algorithms ├── .ipynb_checkpoints │ └── 6-Shor_s_Algorithm-checkpoint.ipynb ├── 1-Quantum_Oracles.ipynb ├── 2-Deutsch_s_Algorithm.ipynb ├── 3-Deutsch-Jozsa_Algorithm.ipynb ├── 4-Grover_s_Algorithm.ipynb ├── 5-Simon_s_Algorithm.ipynb ├── 6-Shor_s_Algorithm.ipynb └── img │ ├── 2_d_b0.png │ ├── 2_d_b1.png │ ├── 2_d_c0.png │ ├── 2_d_c1.png │ ├── 2_d_d.png │ ├── 2_d_d2.png │ ├── 2_d_d3.png │ ├── 2_d_d4.png │ ├── 2_d_d5.png │ ├── 2_d_deutsch.png │ ├── 2_d_or.png │ ├── 2_d_sample01.png │ ├── 2_d_sample01_code.png │ ├── 2_d_sample02.png │ ├── 2_d_sample02_code.png │ ├── 3-dj001.png │ ├── 3-dj002.png │ ├── 3-dj003.png │ ├── 3-dj004.png │ ├── 3-dj005.png │ ├── 3-dj006.png │ ├── 4-g001.png │ ├── 4-g0010.png │ ├── 4-g0011.png │ ├── 4-g0012.png │ ├── 4-g0013.png │ ├── 4-g0014.png │ ├── 4-g0015.png │ ├── 4-g0016.png │ ├── 4-g0017.png │ ├── 4-g0018.png │ ├── 4-g0019.png │ ├── 4-g002.png │ ├── 4-g0020.png │ ├── 4-g0021.png │ ├── 4-g0022_1.png │ ├── 4-g0022_2.png │ ├── 4-g003.png │ ├── 4-g0030.png │ ├── 4-g0031.png │ ├── 4-g0032.png │ ├── 4-g0033.png │ ├── 4-g0034.png │ ├── 4-g0035.png │ ├── 4-g0036.png │ ├── 4-g0037.png │ ├── 4-g0038.png │ ├── 4-g0039.png │ ├── 4-g004.png │ ├── 4-g0040.png │ ├── 4-g0041.png │ ├── 4-g0042.png │ ├── 4-g0043.png │ ├── 4-g0044.png │ ├── 4-g0045.png │ ├── 4-g0046.png │ ├── 4-g0047.png │ ├── 4-g005.png │ ├── 4-g006.png │ ├── 4-g007.png │ ├── 4-g008.png │ ├── 4-g009.png │ ├── 5-ex3.png │ ├── 5-ex41.png │ ├── 5-ex42.png │ ├── 5-fig2.5.1.png │ ├── 5-sac.png │ ├── 6-g001.png │ ├── DJ_exercise1.png │ ├── DJ_exercise2.png │ ├── DJ_exercise3.png │ ├── DJ_exercise4.png │ ├── Deutsch_exercise1.png │ ├── Deutsch_exercise2.png │ ├── Deutsch_exercise3.png │ ├── Deutsch_exercise4.png │ ├── Figure211.png │ ├── Figure212.png │ ├── oracle011.png │ ├── oracle011again.png │ ├── oracle111.png │ ├── oracle111again.png │ └── oracles_unitary.png ├── 3-Quantum_Hardware_Systems ├── 1-Natural_Qubits.ipynb ├── 2-Silicon_Quantum_Dots.ipynb ├── 3-Crystal_Defects.ipynb ├── 4-Trapped_Ions.ipynb ├── 5-Superconductin_Circuits.ipynb ├── 6-Topological_Qubits.ipynb └── image │ ├── 2DEG.png │ ├── 2DEG_quantum_dot.png │ ├── Cooper_pair.png │ ├── Einstein.png │ ├── Hamiltonian.png │ ├── Ising model.png │ ├── LC_circuit.png │ ├── LC_energies.png │ ├── LC_quantum.png │ ├── Majorana_pairs.png │ ├── Majorana_pairs_0.png │ ├── Majorana_pairs_1.png │ ├── Majorana_pairs_2.png │ ├── Maxwell.png │ ├── Stern.png │ ├── Superconducting_gap.png │ ├── T_junction.png │ ├── abelian.png │ ├── bosons_fermions.png │ ├── braiding.png │ ├── braiding_H_gate.png │ ├── braiding_X_gate.png │ ├── braiding_Z_gate.png │ ├── chemical_potential.png │ ├── coherence.png │ ├── conductance.png │ ├── conductor.png │ ├── dilution_fridge.png │ ├── dimensions.png │ ├── fine_structure.png │ ├── fusion_rule.png │ ├── fusion_rules.png │ ├── heating_noise.png │ ├── ion.png │ ├── ion_trap_laser_beam.png │ ├── ion_trap_laser_line.png │ ├── josephson_junction.png │ ├── quantum_dot.png │ ├── quantum_dot_top.png │ ├── quasiparticle.png │ ├── resistance.jpg │ ├── resistance.png │ ├── spin.png │ ├── superconducting.png │ ├── superconductor.png │ ├── topological_qubit_0.png │ ├── topological_qubit_1.png │ ├── topology.png │ ├── train.png │ ├── transistor.png │ ├── two_quantum_dots.png │ ├── two_superconductors.png │ └── vacancy.png ├── 4-Looking_Ahead ├── 1-Cryptography.ipynb ├── Conclusion.md └── image │ ├── Azure_security.png │ ├── BB84.png │ ├── Grover.png │ ├── Mosca.png │ ├── NIST.png │ ├── NIST_crypto.png │ ├── Shor.png │ ├── cryptokey.png │ ├── faster_than_light.png │ └── standarization.png ├── CONTRIBUTING.md ├── HOWTO.md ├── LICENSE.txt ├── QuantumComputingViaQSharpSolution ├── 01_HelloQuantumWorld │ ├── 01_HelloQuantumWorld.csproj │ └── Program.qs ├── 02_Demo using-M-Message-let-Zero-One │ ├── 02_Demo using-M-Message-let-Zero-One.csproj │ └── Program.qs ├── 03_Demo X-Reset │ ├── 03_Demo X-Reset.csproj │ └── Program.qs ├── 04_Demo_ResultAsBool_BoolAsString │ ├── 04_Demo_ResultAsBool_BoolAsString.csproj │ └── Program.qs ├── 05_Demo MultiM-ResetAll │ ├── 05_Demo MultiM-ResetAll.csproj │ └── Program.qs ├── 06_Demo H │ ├── 06_Demo H.csproj │ └── Program.qs ├── 07_Demo H count-mutable-set-for-IntAsString │ ├── 07_Demo H count-mutable-set-for-IntAsString.csproj │ └── Program.qs ├── 08_Demo Parameters │ ├── 08_Demo Parameters.csproj │ └── Program.qs ├── 09_Demo randomNumberGenerator │ ├── 09_Demo randomNumberGenerator.csproj │ ├── 09_Demo randomNumberGenerator.sln │ └── Program.qs ├── 10_Demo_Array_Functions │ ├── 10_Demo_Array_Functions.csproj │ └── Program.qs ├── 11_Demo ResultArrayAsInt │ ├── 11_Demo ResultArrayAsInt.csproj │ └── Program.qs ├── 12_Demo CNOT │ ├── 12_Demo CNOT.csproj │ └── Program.qs ├── 13_Demo CCNOT │ ├── 13_Demo CCNOT.csproj │ └── Program.qs ├── 14_Demo ApplyToEach-Controlled X-ControlledOnBitString │ ├── 14_Demo ApplyToEach-Controlled X-ControlledOnBitString.csproj │ └── Program.qs ├── 15_Demo XAsString-XAsStringWithFormat │ ├── 15_Demo XAsString-XAsStringWithFormat.csproj │ └── Program.qs ├── 16_Demo bool-result-int-conversions │ ├── 16_Demo bool-result-int-conversions.csproj │ └── Program.qs ├── 17_Demo Math Functions │ ├── 17_Demo Math Functions.csproj │ └── Program.qs ├── 18_Demo Rotations │ ├── 18_Demo Rotations.csproj │ └── Program.qs ├── 19_Demo Entanglement │ ├── 19_Demo Entanglement.csproj │ └── Program.qs ├── 20_Demo Teleportation │ ├── 20_Demo Teleportation.csproj │ └── Program.qs ├── 21_Demo Deutsch's Algorithm │ ├── 21_Demo Deutsch's Algorithm.csproj │ └── Program.qs ├── 22_Demo Grover's Algorithm Classical Simulation │ ├── 22_Demo Grover's Algorithm Classical Simulation.csproj │ ├── GroversAlgorithmClassicalSimulation.cs │ └── Program.qs ├── 23_Demo Grover's Algorithm │ ├── 23_Demo Grover's Algorithm.csproj │ └── Program.qs ├── 24_Demo Quantm Circuit for Entangled Addition │ ├── 24_Demo Quantm Circuit for Entangled Addition.csproj │ └── Program.qs ├── 25_Demo Shor's Algorithm Classical Simulation │ ├── 25_Demo_Shor_s_Algorithm_Classical_Simulation.csproj │ ├── Program.qs │ └── Shor_s_Algorithm.cs ├── 26_Demo Deutsch_Jozsa algorithm │ ├── 26_Demo Deutsch_Jozsa algorithm.csproj │ └── Program.qs ├── 27_Demo Simon's Algorithm │ ├── 27_Demo Simon's Algorithm.csproj │ └── Program.qs └── QuantumComputingViaQSharpSolution.sln ├── README.md ├── SECURITY.md ├── TOC.md └── media ├── jupyter_1.png └── jupyter_2.png /.gitignore: -------------------------------------------------------------------------------- 1 | ## Ignore Visual Studio temporary files, build results, and 2 | ## files generated by popular Visual Studio add-ons. 3 | ## 4 | ## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore 5 | 6 | # User-specific files 7 | *.rsuser 8 | *.suo 9 | *.user 10 | *.userosscache 11 | *.sln.docstates 12 | 13 | # User-specific files (MonoDevelop/Xamarin Studio) 14 | *.userprefs 15 | 16 | # Mono auto generated files 17 | mono_crash.* 18 | 19 | # Build results 20 | [Dd]ebug/ 21 | [Dd]ebugPublic/ 22 | [Rr]elease/ 23 | [Rr]eleases/ 24 | x64/ 25 | x86/ 26 | [Aa][Rr][Mm]/ 27 | [Aa][Rr][Mm]64/ 28 | bld/ 29 | [Bb]in/ 30 | [Oo]bj/ 31 | [Ll]og/ 32 | [Ll]ogs/ 33 | 34 | # Visual Studio 2015/2017 cache/options directory 35 | .vs/ 36 | 37 | # Uncomment if you have tasks that create the project's static files in wwwroot 38 | #wwwroot/ 39 | 40 | # Visual Studio 2017 auto generated files 41 | Generated\ Files/ 42 | 43 | # MSTest test Results 44 | [Tt]est[Rr]esult*/ 45 | [Bb]uild[Ll]og.* 46 | 47 | # NUnit 48 | *.VisualState.xml 49 | TestResult.xml 50 | nunit-*.xml 51 | 52 | # Build Results of an ATL Project 53 | [Dd]ebugPS/ 54 | [Rr]eleasePS/ 55 | dlldata.c 56 | 57 | # Benchmark Results 58 | BenchmarkDotNet.Artifacts/ 59 | 60 | # .NET Core 61 | project.lock.json 62 | project.fragment.lock.json 63 | artifacts/ 64 | 65 | # StyleCop 66 | StyleCopReport.xml 67 | 68 | # Files built by Visual Studio 69 | *_i.c 70 | *_p.c 71 | *_h.h 72 | *.ilk 73 | *.meta 74 | *.obj 75 | *.iobj 76 | *.pch 77 | *.pdb 78 | *.ipdb 79 | *.pgc 80 | *.pgd 81 | *.rsp 82 | *.sbr 83 | *.tlb 84 | *.tli 85 | *.tlh 86 | *.tmp 87 | *.tmp_proj 88 | *_wpftmp.csproj 89 | *.log 90 | *.vspscc 91 | *.vssscc 92 | .builds 93 | *.pidb 94 | *.svclog 95 | *.scc 96 | 97 | # Chutzpah Test files 98 | _Chutzpah* 99 | 100 | # Visual C++ cache files 101 | ipch/ 102 | *.aps 103 | *.ncb 104 | *.opendb 105 | *.opensdf 106 | *.sdf 107 | *.cachefile 108 | *.VC.db 109 | *.VC.VC.opendb 110 | 111 | # Visual Studio profiler 112 | *.psess 113 | *.vsp 114 | *.vspx 115 | *.sap 116 | 117 | # Visual Studio Trace Files 118 | *.e2e 119 | 120 | # TFS 2012 Local Workspace 121 | $tf/ 122 | 123 | # Guidance Automation Toolkit 124 | *.gpState 125 | 126 | # ReSharper is a .NET coding add-in 127 | _ReSharper*/ 128 | *.[Rr]e[Ss]harper 129 | *.DotSettings.user 130 | 131 | # TeamCity is a build add-in 132 | _TeamCity* 133 | 134 | # DotCover is a Code Coverage Tool 135 | *.dotCover 136 | 137 | # AxoCover is a Code Coverage Tool 138 | .axoCover/* 139 | !.axoCover/settings.json 140 | 141 | # Visual Studio code coverage results 142 | *.coverage 143 | *.coveragexml 144 | 145 | # NCrunch 146 | _NCrunch_* 147 | .*crunch*.local.xml 148 | nCrunchTemp_* 149 | 150 | # MightyMoose 151 | *.mm.* 152 | AutoTest.Net/ 153 | 154 | # Web workbench (sass) 155 | .sass-cache/ 156 | 157 | # Installshield output folder 158 | [Ee]xpress/ 159 | 160 | # DocProject is a documentation generator add-in 161 | DocProject/buildhelp/ 162 | DocProject/Help/*.HxT 163 | DocProject/Help/*.HxC 164 | DocProject/Help/*.hhc 165 | DocProject/Help/*.hhk 166 | DocProject/Help/*.hhp 167 | DocProject/Help/Html2 168 | DocProject/Help/html 169 | 170 | # Click-Once directory 171 | publish/ 172 | 173 | # Publish Web Output 174 | *.[Pp]ublish.xml 175 | *.azurePubxml 176 | # Note: Comment the next line if you want to checkin your web deploy settings, 177 | # but database connection strings (with potential passwords) will be unencrypted 178 | *.pubxml 179 | *.publishproj 180 | 181 | # Microsoft Azure Web App publish settings. Comment the next line if you want to 182 | # checkin your Azure Web App publish settings, but sensitive information contained 183 | # in these scripts will be unencrypted 184 | PublishScripts/ 185 | 186 | # NuGet Packages 187 | *.nupkg 188 | # NuGet Symbol Packages 189 | *.snupkg 190 | # The packages folder can be ignored because of Package Restore 191 | **/[Pp]ackages/* 192 | # except build/, which is used as an MSBuild target. 193 | !**/[Pp]ackages/build/ 194 | # Uncomment if necessary however generally it will be regenerated when needed 195 | #!**/[Pp]ackages/repositories.config 196 | # NuGet v3's project.json files produces more ignorable files 197 | *.nuget.props 198 | *.nuget.targets 199 | 200 | # Microsoft Azure Build Output 201 | csx/ 202 | *.build.csdef 203 | 204 | # Microsoft Azure Emulator 205 | ecf/ 206 | rcf/ 207 | 208 | # Windows Store app package directories and files 209 | AppPackages/ 210 | BundleArtifacts/ 211 | Package.StoreAssociation.xml 212 | _pkginfo.txt 213 | *.appx 214 | *.appxbundle 215 | *.appxupload 216 | 217 | # Visual Studio cache files 218 | # files ending in .cache can be ignored 219 | *.[Cc]ache 220 | # but keep track of directories ending in .cache 221 | !?*.[Cc]ache/ 222 | 223 | # Others 224 | ClientBin/ 225 | ~$* 226 | *~ 227 | *.dbmdl 228 | *.dbproj.schemaview 229 | *.jfm 230 | *.pfx 231 | *.publishsettings 232 | orleans.codegen.cs 233 | 234 | # Including strong name files can present a security risk 235 | # (https://github.com/github/gitignore/pull/2483#issue-259490424) 236 | #*.snk 237 | 238 | # Since there are multiple workflows, uncomment next line to ignore bower_components 239 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) 240 | #bower_components/ 241 | 242 | # RIA/Silverlight projects 243 | Generated_Code/ 244 | 245 | # Backup & report files from converting an old project file 246 | # to a newer Visual Studio version. Backup files are not needed, 247 | # because we have git ;-) 248 | _UpgradeReport_Files/ 249 | Backup*/ 250 | UpgradeLog*.XML 251 | UpgradeLog*.htm 252 | ServiceFabricBackup/ 253 | *.rptproj.bak 254 | 255 | # SQL Server files 256 | *.mdf 257 | *.ldf 258 | *.ndf 259 | 260 | # Business Intelligence projects 261 | *.rdl.data 262 | *.bim.layout 263 | *.bim_*.settings 264 | *.rptproj.rsuser 265 | *- [Bb]ackup.rdl 266 | *- [Bb]ackup ([0-9]).rdl 267 | *- [Bb]ackup ([0-9][0-9]).rdl 268 | 269 | # Microsoft Fakes 270 | FakesAssemblies/ 271 | 272 | # GhostDoc plugin setting file 273 | *.GhostDoc.xml 274 | 275 | # Node.js Tools for Visual Studio 276 | .ntvs_analysis.dat 277 | node_modules/ 278 | 279 | # Visual Studio 6 build log 280 | *.plg 281 | 282 | # Visual Studio 6 workspace options file 283 | *.opt 284 | 285 | # Visual Studio 6 auto-generated workspace file (contains which files were open etc.) 286 | *.vbw 287 | 288 | # Visual Studio LightSwitch build output 289 | **/*.HTMLClient/GeneratedArtifacts 290 | **/*.DesktopClient/GeneratedArtifacts 291 | **/*.DesktopClient/ModelManifest.xml 292 | **/*.Server/GeneratedArtifacts 293 | **/*.Server/ModelManifest.xml 294 | _Pvt_Extensions 295 | 296 | # Paket dependency manager 297 | .paket/paket.exe 298 | paket-files/ 299 | 300 | # FAKE - F# Make 301 | .fake/ 302 | 303 | # CodeRush personal settings 304 | .cr/personal 305 | 306 | # Python Tools for Visual Studio (PTVS) 307 | __pycache__/ 308 | *.pyc 309 | 310 | # Cake - Uncomment if you are using it 311 | # tools/** 312 | # !tools/packages.config 313 | 314 | # Tabs Studio 315 | *.tss 316 | 317 | # Telerik's JustMock configuration file 318 | *.jmconfig 319 | 320 | # BizTalk build output 321 | *.btp.cs 322 | *.btm.cs 323 | *.odx.cs 324 | *.xsd.cs 325 | 326 | # OpenCover UI analysis results 327 | OpenCover/ 328 | 329 | # Azure Stream Analytics local run output 330 | ASALocalRun/ 331 | 332 | # MSBuild Binary and Structured Log 333 | *.binlog 334 | 335 | # NVidia Nsight GPU debugger configuration file 336 | *.nvuser 337 | 338 | # MFractors (Xamarin productivity tool) working folder 339 | .mfractor/ 340 | 341 | # Local History for Visual Studio 342 | .localhistory/ 343 | 344 | # BeatPulse healthcheck temp database 345 | healthchecksdb 346 | 347 | # Backup folder for Package Reference Convert tool in Visual Studio 2017 348 | MigrationBackup/ 349 | 350 | # Ionide (cross platform F# VS Code tools) working folder 351 | .ionide/ 352 | 353 | # VSCode user settings folder 354 | .vscode -------------------------------------------------------------------------------- /1-Basic_Quantum_Concepts/5-No-Cloning_Theorem.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "markdown", 5 | "metadata": {}, 6 | "source": [ 7 | "## 1.5 The No-Cloning Theorem\n", 8 | "\n", 9 | "The No-Cloning theorem states that we cannot copy an arbitrary quantum state from one qubit [or set of\n", 10 | "qubits) to another qubit (or set of qubits). The No-Cloning theorem was first proven by (James Park in\n", 11 | "1970](https://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.623.5267) and then re-discovered by [Wootters and Zurek](https://www.nature.com/articles/299802a0) and [Dieks](https://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.654.7183) in 1982. Classical programmers are\n", 12 | "accustomed to making copies of state to execute various algorithms, but the nature of quantum\n", 13 | "mechanics makes this impossible for quantum computing.\n", 14 | "\n", 15 | "For an arbitrary state, let's say for one qubit, $|\\phi\\rangle=\\alpha|0\\rangle+\\beta|1\\rangle$. A copy function would act like\n", 16 | "this: $Copy(|\\phi\\rangle \\otimes |0\\rangle)$ would produce $|\\phi\\rangle \\otimes |\\phi\\rangle$ where we copy the state $|\\phi\\rangle$ over the $|0\\rangle$ state. Can\n", 17 | "this $Copy$ function exist? (Recall from the discussion above, that in order to be a quantum operator, this\n", 18 | "$Copy$ function must be unitary).\n", 19 | "\n", 20 | "There are many different proofs of the No-Cloning Theorem and all of them follow the same\n", 21 | "pattern - assume we have such a Copy function like this one and then prove that in order for the function\n", 22 | "to exist, it would have to be non-Unitary, which is a contradiction. The proof below is due to the [Brilliant\n", 23 | "Quantum Computing course](https://brilliant.org/courses/quantum-computing/).\n", 24 | "\n", 25 | "\n", 26 | "_Math insert – Proof of No-Cloning Theorem_-------------------------------------------------------------------\n", 27 | "\n", 28 | ">Assume we have a function, Copy, such that:\n", 29 | ">\n", 30 | ">$Copy (|\\phi\\rangle \\otimes |0\\rangle)=|\\phi\\rangle \\otimes |\\phi\\rangle$\n", 31 | ">\n", 32 | ">which would expand out to (substituting for $|\\phi\\rangle$):\n", 33 | ">\n", 34 | ">$=(\\alpha|0\\rangle+\\beta|1\\rangle) \\otimes (\\alpha|0\\rangle+\\beta|1\\rangle)$\n", 35 | ">$=\\alpha^2|00\\rangle+\\beta^2|11\\rangle+\\alpha\\beta(|01\\rangle+|10\\rangle)$. eq.(1.5.1)\n", 36 | ">\n", 37 | ">You can also evaluate the Copy function by expanding $|\\phi\\rangle$ first:\n", 38 | ">$Copy(|\\phi\\rangle \\otimes |0\\rangle) = Copy(\\alpha|0\\rangle \\otimes |1\\rangle+\\beta|1\\rangle \\otimes |1\\rangle)$\n", 39 | ">$=\\alpha(Copy|00\\rangle)+\\beta(Copy|10\\rangle)$\n", 40 | ">$=\\alpha|00\\rangle+\\beta|11\\rangle$. eq.(1.5.2)\n", 41 | ">\n", 42 | ">Here we have our contradiction, because both eq.(1.5.1) and eq.(1.5.2) cannot be true at the same time for\n", 43 | "an arbitrary state.\n", 44 | "\n", 45 | "An alternative formulation of the No-Cloning Theorem can be found in [Physics, Topology, Logic\n", 46 | "and Computation](https://arxiv.org/abs/0903.0340v3): A Rosetta Stone, on page 19. Here is a brief quote:\n", 47 | "\n", 48 | "_In the case of Set, this says that every point of the set $X x X'$ comes from a point of X and a point of X′. In\n", 49 | "physics, this would say that every state g of the combined system $X \\otimes X'$ is built by combining states of the\n", 50 | "systems $X$ and $X'$. Bell's theorem says that is not true in quantum theory. The reason is that quantum theory\n", 51 | "uses the non-Cartesian monoidal category Hilb! Also, in quantum theory we cannot freely duplicate or\n", 52 | "delete information. Wootters and Zurek proved a precise theorem to this effect, focused on duplication:\n", 53 | "the 'no-cloning theorem'. One can also prove a 'no deletion theorem'. Again, these results rely on the non-\n", 54 | "Cartesian tensor product in Hilb._ (Note that Hilb is the Category corresponding to Hilbert Space)\n", 55 | "\n", 56 | "**Additional material:** Scott Aaronson has asked an interesting question: what if the No-Cloning Theorem\n", 57 | "is not just a by-product of quantum physics, but what if the privacy of quantum mechanical events is part\n", 58 | "of the fundamental nature of the universe? His entertaining and thought-provoking talk is posted on his\n", 59 | "[blog](https://www.scottaaronson.com/blog/?p=2903). There is also a [video version](https://www.youtube.com/watch?v=kXerI-tnW50).\n" 60 | ] 61 | }, 62 | { 63 | "cell_type": "code", 64 | "execution_count": null, 65 | "metadata": {}, 66 | "outputs": [], 67 | "source": [] 68 | } 69 | ], 70 | "metadata": { 71 | "language_info": { 72 | "codemirror_mode": { 73 | "name": "ipython", 74 | "version": 3 75 | }, 76 | "file_extension": ".py", 77 | "mimetype": "text/x-python", 78 | "name": "python", 79 | "nbconvert_exporter": "python", 80 | "pygments_lexer": "ipython3", 81 | "version": "3.8.3-final" 82 | }, 83 | "orig_nbformat": 2, 84 | "kernelspec": { 85 | "name": "python38332bit225b1603132a4a1f9abff16033481403", 86 | "display_name": "Python 3.8.3 32-bit" 87 | } 88 | }, 89 | "nbformat": 4, 90 | "nbformat_minor": 2 91 | } -------------------------------------------------------------------------------- /1-Basic_Quantum_Concepts/media/Bell_state_circuit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/Reference-Guide-For-Quantum-Computing-A-Microsoft-Garage-Project/c1533b9472cbfe09b0e15a964d0c6fd73a8831fe/1-Basic_Quantum_Concepts/media/Bell_state_circuit.png -------------------------------------------------------------------------------- /1-Basic_Quantum_Concepts/media/Bell_state_table.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/Reference-Guide-For-Quantum-Computing-A-Microsoft-Garage-Project/c1533b9472cbfe09b0e15a964d0c6fd73a8831fe/1-Basic_Quantum_Concepts/media/Bell_state_table.png -------------------------------------------------------------------------------- /1-Basic_Quantum_Concepts/media/CHSH_game.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/Reference-Guide-For-Quantum-Computing-A-Microsoft-Garage-Project/c1533b9472cbfe09b0e15a964d0c6fd73a8831fe/1-Basic_Quantum_Concepts/media/CHSH_game.png -------------------------------------------------------------------------------- /1-Basic_Quantum_Concepts/media/CHSH_game_quirk.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/Reference-Guide-For-Quantum-Computing-A-Microsoft-Garage-Project/c1533b9472cbfe09b0e15a964d0c6fd73a8831fe/1-Basic_Quantum_Concepts/media/CHSH_game_quirk.png -------------------------------------------------------------------------------- /1-Basic_Quantum_Concepts/media/CNOTgate_excercise.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/Reference-Guide-For-Quantum-Computing-A-Microsoft-Garage-Project/c1533b9472cbfe09b0e15a964d0c6fd73a8831fe/1-Basic_Quantum_Concepts/media/CNOTgate_excercise.png -------------------------------------------------------------------------------- /1-Basic_Quantum_Concepts/media/CNOTgate_excercise2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/Reference-Guide-For-Quantum-Computing-A-Microsoft-Garage-Project/c1533b9472cbfe09b0e15a964d0c6fd73a8831fe/1-Basic_Quantum_Concepts/media/CNOTgate_excercise2.png -------------------------------------------------------------------------------- /1-Basic_Quantum_Concepts/media/CNOTgate_excercise3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/Reference-Guide-For-Quantum-Computing-A-Microsoft-Garage-Project/c1533b9472cbfe09b0e15a964d0c6fd73a8831fe/1-Basic_Quantum_Concepts/media/CNOTgate_excercise3.png -------------------------------------------------------------------------------- /1-Basic_Quantum_Concepts/media/Kronecker_product.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/Reference-Guide-For-Quantum-Computing-A-Microsoft-Garage-Project/c1533b9472cbfe09b0e15a964d0c6fd73a8831fe/1-Basic_Quantum_Concepts/media/Kronecker_product.png -------------------------------------------------------------------------------- /1-Basic_Quantum_Concepts/media/applyingrandomizingmatrix.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/Reference-Guide-For-Quantum-Computing-A-Microsoft-Garage-Project/c1533b9472cbfe09b0e15a964d0c6fd73a8831fe/1-Basic_Quantum_Concepts/media/applyingrandomizingmatrix.png -------------------------------------------------------------------------------- /1-Basic_Quantum_Concepts/media/blochspherearbitrary.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/Reference-Guide-For-Quantum-Computing-A-Microsoft-Garage-Project/c1533b9472cbfe09b0e15a964d0c6fd73a8831fe/1-Basic_Quantum_Concepts/media/blochspherearbitrary.png -------------------------------------------------------------------------------- /1-Basic_Quantum_Concepts/media/blochspherehadamard.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/Reference-Guide-For-Quantum-Computing-A-Microsoft-Garage-Project/c1533b9472cbfe09b0e15a964d0c6fd73a8831fe/1-Basic_Quantum_Concepts/media/blochspherehadamard.png -------------------------------------------------------------------------------- /1-Basic_Quantum_Concepts/media/blochspherepauli.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/Reference-Guide-For-Quantum-Computing-A-Microsoft-Garage-Project/c1533b9472cbfe09b0e15a964d0c6fd73a8831fe/1-Basic_Quantum_Concepts/media/blochspherepauli.png -------------------------------------------------------------------------------- /1-Basic_Quantum_Concepts/media/blochsphereplusminus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/Reference-Guide-For-Quantum-Computing-A-Microsoft-Garage-Project/c1533b9472cbfe09b0e15a964d0c6fd73a8831fe/1-Basic_Quantum_Concepts/media/blochsphereplusminus.png -------------------------------------------------------------------------------- /1-Basic_Quantum_Concepts/media/blochspherezeroone.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/Reference-Guide-For-Quantum-Computing-A-Microsoft-Garage-Project/c1533b9472cbfe09b0e15a964d0c6fd73a8831fe/1-Basic_Quantum_Concepts/media/blochspherezeroone.png -------------------------------------------------------------------------------- /1-Basic_Quantum_Concepts/media/circuitRepresentationhadamard.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/Reference-Guide-For-Quantum-Computing-A-Microsoft-Garage-Project/c1533b9472cbfe09b0e15a964d0c6fd73a8831fe/1-Basic_Quantum_Concepts/media/circuitRepresentationhadamard.png -------------------------------------------------------------------------------- /1-Basic_Quantum_Concepts/media/circuitRepresentationqubit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/Reference-Guide-For-Quantum-Computing-A-Microsoft-Garage-Project/c1533b9472cbfe09b0e15a964d0c6fd73a8831fe/1-Basic_Quantum_Concepts/media/circuitRepresentationqubit.png -------------------------------------------------------------------------------- /1-Basic_Quantum_Concepts/media/circuitrepresentationcnot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/Reference-Guide-For-Quantum-Computing-A-Microsoft-Garage-Project/c1533b9472cbfe09b0e15a964d0c6fd73a8831fe/1-Basic_Quantum_Concepts/media/circuitrepresentationcnot.png -------------------------------------------------------------------------------- /1-Basic_Quantum_Concepts/media/circuitrepresentationpauli.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/Reference-Guide-For-Quantum-Computing-A-Microsoft-Garage-Project/c1533b9472cbfe09b0e15a964d0c6fd73a8831fe/1-Basic_Quantum_Concepts/media/circuitrepresentationpauli.png -------------------------------------------------------------------------------- /1-Basic_Quantum_Concepts/media/complex_numbers.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/Reference-Guide-For-Quantum-Computing-A-Microsoft-Garage-Project/c1533b9472cbfe09b0e15a964d0c6fd73a8831fe/1-Basic_Quantum_Concepts/media/complex_numbers.png -------------------------------------------------------------------------------- /1-Basic_Quantum_Concepts/media/constructiveinterference.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/Reference-Guide-For-Quantum-Computing-A-Microsoft-Garage-Project/c1533b9472cbfe09b0e15a964d0c6fd73a8831fe/1-Basic_Quantum_Concepts/media/constructiveinterference.png -------------------------------------------------------------------------------- /1-Basic_Quantum_Concepts/media/cover small crop.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/Reference-Guide-For-Quantum-Computing-A-Microsoft-Garage-Project/c1533b9472cbfe09b0e15a964d0c6fd73a8831fe/1-Basic_Quantum_Concepts/media/cover small crop.png -------------------------------------------------------------------------------- /1-Basic_Quantum_Concepts/media/cover small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/Reference-Guide-For-Quantum-Computing-A-Microsoft-Garage-Project/c1533b9472cbfe09b0e15a964d0c6fd73a8831fe/1-Basic_Quantum_Concepts/media/cover small.png -------------------------------------------------------------------------------- /1-Basic_Quantum_Concepts/media/dirac_notation.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/Reference-Guide-For-Quantum-Computing-A-Microsoft-Garage-Project/c1533b9472cbfe09b0e15a964d0c6fd73a8831fe/1-Basic_Quantum_Concepts/media/dirac_notation.png -------------------------------------------------------------------------------- /1-Basic_Quantum_Concepts/media/entanglement.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/Reference-Guide-For-Quantum-Computing-A-Microsoft-Garage-Project/c1533b9472cbfe09b0e15a964d0c6fd73a8831fe/1-Basic_Quantum_Concepts/media/entanglement.png -------------------------------------------------------------------------------- /1-Basic_Quantum_Concepts/media/faster_than_light.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/Reference-Guide-For-Quantum-Computing-A-Microsoft-Garage-Project/c1533b9472cbfe09b0e15a964d0c6fd73a8831fe/1-Basic_Quantum_Concepts/media/faster_than_light.png -------------------------------------------------------------------------------- /1-Basic_Quantum_Concepts/media/gate.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/Reference-Guide-For-Quantum-Computing-A-Microsoft-Garage-Project/c1533b9472cbfe09b0e15a964d0c6fd73a8831fe/1-Basic_Quantum_Concepts/media/gate.png -------------------------------------------------------------------------------- /1-Basic_Quantum_Concepts/media/interference.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/Reference-Guide-For-Quantum-Computing-A-Microsoft-Garage-Project/c1533b9472cbfe09b0e15a964d0c6fd73a8831fe/1-Basic_Quantum_Concepts/media/interference.png -------------------------------------------------------------------------------- /1-Basic_Quantum_Concepts/media/measurement.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/Reference-Guide-For-Quantum-Computing-A-Microsoft-Garage-Project/c1533b9472cbfe09b0e15a964d0c6fd73a8831fe/1-Basic_Quantum_Concepts/media/measurement.png -------------------------------------------------------------------------------- /1-Basic_Quantum_Concepts/media/measurement_exercise.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/Reference-Guide-For-Quantum-Computing-A-Microsoft-Garage-Project/c1533b9472cbfe09b0e15a964d0c6fd73a8831fe/1-Basic_Quantum_Concepts/media/measurement_exercise.png -------------------------------------------------------------------------------- /1-Basic_Quantum_Concepts/media/mistake.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/Reference-Guide-For-Quantum-Computing-A-Microsoft-Garage-Project/c1533b9472cbfe09b0e15a964d0c6fd73a8831fe/1-Basic_Quantum_Concepts/media/mistake.png -------------------------------------------------------------------------------- /1-Basic_Quantum_Concepts/media/multiple_qubits.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/Reference-Guide-For-Quantum-Computing-A-Microsoft-Garage-Project/c1533b9472cbfe09b0e15a964d0c6fd73a8831fe/1-Basic_Quantum_Concepts/media/multiple_qubits.png -------------------------------------------------------------------------------- /1-Basic_Quantum_Concepts/media/multiplyingamplitudes.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/Reference-Guide-For-Quantum-Computing-A-Microsoft-Garage-Project/c1533b9472cbfe09b0e15a964d0c6fd73a8831fe/1-Basic_Quantum_Concepts/media/multiplyingamplitudes.png -------------------------------------------------------------------------------- /1-Basic_Quantum_Concepts/media/probabilitytrees.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/Reference-Guide-For-Quantum-Computing-A-Microsoft-Garage-Project/c1533b9472cbfe09b0e15a964d0c6fd73a8831fe/1-Basic_Quantum_Concepts/media/probabilitytrees.png -------------------------------------------------------------------------------- /1-Basic_Quantum_Concepts/media/quirk1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/Reference-Guide-For-Quantum-Computing-A-Microsoft-Garage-Project/c1533b9472cbfe09b0e15a964d0c6fd73a8831fe/1-Basic_Quantum_Concepts/media/quirk1.png -------------------------------------------------------------------------------- /1-Basic_Quantum_Concepts/media/quirk2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/Reference-Guide-For-Quantum-Computing-A-Microsoft-Garage-Project/c1533b9472cbfe09b0e15a964d0c6fd73a8831fe/1-Basic_Quantum_Concepts/media/quirk2.png -------------------------------------------------------------------------------- /1-Basic_Quantum_Concepts/media/quirk3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/Reference-Guide-For-Quantum-Computing-A-Microsoft-Garage-Project/c1533b9472cbfe09b0e15a964d0c6fd73a8831fe/1-Basic_Quantum_Concepts/media/quirk3.png -------------------------------------------------------------------------------- /1-Basic_Quantum_Concepts/media/spinning_coin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/Reference-Guide-For-Quantum-Computing-A-Microsoft-Garage-Project/c1533b9472cbfe09b0e15a964d0c6fd73a8831fe/1-Basic_Quantum_Concepts/media/spinning_coin.png -------------------------------------------------------------------------------- /1-Basic_Quantum_Concepts/media/states.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/Reference-Guide-For-Quantum-Computing-A-Microsoft-Garage-Project/c1533b9472cbfe09b0e15a964d0c6fd73a8831fe/1-Basic_Quantum_Concepts/media/states.png -------------------------------------------------------------------------------- /1-Basic_Quantum_Concepts/media/superdense.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/Reference-Guide-For-Quantum-Computing-A-Microsoft-Garage-Project/c1533b9472cbfe09b0e15a964d0c6fd73a8831fe/1-Basic_Quantum_Concepts/media/superdense.png -------------------------------------------------------------------------------- /1-Basic_Quantum_Concepts/media/superdense_wiki.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/Reference-Guide-For-Quantum-Computing-A-Microsoft-Garage-Project/c1533b9472cbfe09b0e15a964d0c6fd73a8831fe/1-Basic_Quantum_Concepts/media/superdense_wiki.png -------------------------------------------------------------------------------- /1-Basic_Quantum_Concepts/media/superposition.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/Reference-Guide-For-Quantum-Computing-A-Microsoft-Garage-Project/c1533b9472cbfe09b0e15a964d0c6fd73a8831fe/1-Basic_Quantum_Concepts/media/superposition.png -------------------------------------------------------------------------------- /1-Basic_Quantum_Concepts/media/teleportation.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/Reference-Guide-For-Quantum-Computing-A-Microsoft-Garage-Project/c1533b9472cbfe09b0e15a964d0c6fd73a8831fe/1-Basic_Quantum_Concepts/media/teleportation.png -------------------------------------------------------------------------------- /1-Basic_Quantum_Concepts/media/teleportation_circuit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/Reference-Guide-For-Quantum-Computing-A-Microsoft-Garage-Project/c1533b9472cbfe09b0e15a964d0c6fd73a8831fe/1-Basic_Quantum_Concepts/media/teleportation_circuit.png -------------------------------------------------------------------------------- /1-Basic_Quantum_Concepts/media/teleportation_circuit1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/Reference-Guide-For-Quantum-Computing-A-Microsoft-Garage-Project/c1533b9472cbfe09b0e15a964d0c6fd73a8831fe/1-Basic_Quantum_Concepts/media/teleportation_circuit1.png -------------------------------------------------------------------------------- /1-Basic_Quantum_Concepts/media/teleportation_circuit2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/Reference-Guide-For-Quantum-Computing-A-Microsoft-Garage-Project/c1533b9472cbfe09b0e15a964d0c6fd73a8831fe/1-Basic_Quantum_Concepts/media/teleportation_circuit2.png -------------------------------------------------------------------------------- /1-Basic_Quantum_Concepts/media/teleportation_circuit3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/Reference-Guide-For-Quantum-Computing-A-Microsoft-Garage-Project/c1533b9472cbfe09b0e15a964d0c6fd73a8831fe/1-Basic_Quantum_Concepts/media/teleportation_circuit3.png -------------------------------------------------------------------------------- /1-Basic_Quantum_Concepts/media/teleportation_circuit4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/Reference-Guide-For-Quantum-Computing-A-Microsoft-Garage-Project/c1533b9472cbfe09b0e15a964d0c6fd73a8831fe/1-Basic_Quantum_Concepts/media/teleportation_circuit4.png -------------------------------------------------------------------------------- /1-Basic_Quantum_Concepts/media/teleportation_quirk.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/Reference-Guide-For-Quantum-Computing-A-Microsoft-Garage-Project/c1533b9472cbfe09b0e15a964d0c6fd73a8831fe/1-Basic_Quantum_Concepts/media/teleportation_quirk.png -------------------------------------------------------------------------------- /1-Basic_Quantum_Concepts/media/teleportation_screen1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/Reference-Guide-For-Quantum-Computing-A-Microsoft-Garage-Project/c1533b9472cbfe09b0e15a964d0c6fd73a8831fe/1-Basic_Quantum_Concepts/media/teleportation_screen1.png -------------------------------------------------------------------------------- /1-Basic_Quantum_Concepts/media/teleportation_screen2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/Reference-Guide-For-Quantum-Computing-A-Microsoft-Garage-Project/c1533b9472cbfe09b0e15a964d0c6fd73a8831fe/1-Basic_Quantum_Concepts/media/teleportation_screen2.png -------------------------------------------------------------------------------- /1-Basic_Quantum_Concepts/media/teleportation_table.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/Reference-Guide-For-Quantum-Computing-A-Microsoft-Garage-Project/c1533b9472cbfe09b0e15a964d0c6fd73a8831fe/1-Basic_Quantum_Concepts/media/teleportation_table.png -------------------------------------------------------------------------------- /1-Basic_Quantum_Concepts/media/wavefunction.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/Reference-Guide-For-Quantum-Computing-A-Microsoft-Garage-Project/c1533b9472cbfe09b0e15a964d0c6fd73a8831fe/1-Basic_Quantum_Concepts/media/wavefunction.png -------------------------------------------------------------------------------- /2-Quantum_Algorithms/.ipynb_checkpoints/6-Shor_s_Algorithm-checkpoint.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "markdown", 5 | "metadata": {}, 6 | "source": [ 7 | "Shor's algorithm was invented by Peter Shor in 1994 as a quantum computing algorithm to efficiently find prime factors of an integer. It is an important algorithm because the current widely used RSA cryptography scheme relies on the fact that large integers take unfeasible amount of time to factor on classical computers. With Shor's algorithm implemented when quantum computers are ready, existing cryptography will be broken.\n", 8 | "\n", 9 | "Let's say there are two large prime numbers $\\textit{p}$ and $\\textit{q}$. You are given the product of them 푝푝.푞푞, not the individual 푝푝 and 푞푞. If 푝푝.푞푞 is a small number, you can calculate possible values of 푝푝 and 푞푞. But if the product is large, there is no classical algorithm invented so far to give the components 푝푝 and 푞푞 in polynomial time. That is, if we try to factor a 2048 bit number which is a product of two large prime numbers, it will take more than the age of the universe even if you use the fastest supercomputer. However, using the Shor's algorithm, we can do it within in a few hours provided we have a quantum computer with a few thousand qubits.\n", 10 | "\n", 11 | "To demonstrate this algorithm, let's take 퐶퐶= 35 as the number we want to factorize, and we want to know 푝푝 and 푞푞 that this 퐶퐶 is composed of.\n", 12 | "\n", 13 | "Step 1:\n", 14 | "\n", 15 | "Pick a random number 푎푎 between 2 and 퐶퐶− 1 and take the greatest common denominator (GCD) with 퐶퐶. We need to remember that GCD of large numbers can be found in polynomial time using Euclidean algorithm. If the GCD does not equal to 1 (GCD != 1), then we can say that the GCD is one of the factor and we find the solution. For example, if we had chosen 푎푎 = 10 , then GCD (10, 35) = 5. Since it is not equal to 1, then 5 must be the factor. However, the probability of finding this random number to be the solution is extremely low. If we took 푎푎 = 3, then GCD (3,35) = 1, i.e. 푎푎 and 퐶퐶 are co-primes.\n", 16 | "\n", 17 | "Step 2:\n", 18 | "\n", 19 | "Find some number 푄푄 = 2 푞푞 such that 푄푄 is the first power of 2 greater than or equal to 퐶퐶^2. In this example 퐶퐶^2 = 352 = 1225; so 푄푄 = 2048 and 푞푞 = 11.\n", 20 | "\n", 21 | "Step 3:\n", 22 | "\n", 23 | "Evaluate the expression 푎푎푥푥푀푀 푓푓푑푑 퐶퐶 for all 푥푥 ranging from 0 to 푄푄− 1\n", 24 | "\n", 25 | "TABLE\n", 26 | "\n", 27 | "Step 4:\n", 28 | "\n", 29 | "As you can see in Step 3, the period, 푟푟, is 12 in this case.\n", 30 | "\n", 31 | "Step 5:\n", 32 | "\n", 33 | "We observe the following:\n", 34 | "\n", 35 | "푎푎^0 푀푀푓푓푑푑 퐶퐶 = 30 푀푀 푓푓푑푑 35 = 푎푎푔푔푀푀푓푓푑푑 퐶퐶 = 312 푀푀 푓푓푑푑 35 = 1,\n", 36 | "\n", 37 | "which means that 푎푎푔푔 is the first non-zero number when divided by 퐶퐶 gives the reminder 1. We can say that 푎푎푔푔- 1 will be divisible by 퐶퐶. This is written as 퐶퐶 | 푎푎푔푔- 1 (read as 퐶퐶 divides 푎푎푔푔- 1). If r is even, then we can rewrite it as follows:\n", 38 | "\n", 39 | "퐶퐶 | 푎푎푔푔- 12\n", 40 | "\n", 41 | "\n", 42 | "퐶퐶 | (푎푎푔푔/^2 )^2 - 12\n", 43 | "\n", 44 | "퐶퐶 | (푎푎푔푔/^2 - 1) (푎푎푔푔/^2 + 1) ( because 푎푎^2 − 푏푏^2 = (푎푎−푏푏)(푎푎+푏푏) ).\n", 45 | "\n", 46 | "If 푟푟 turns out to be odd, then we need to repeat Step 1 by picking another 푎푎. Also, if 퐶퐶 | (푎푎푔푔/^2 + 1), we need to discard 푟푟 and repeat Step 1. It will be clear soon why we need to do these.\n", 47 | "\n", 48 | "In addition, we clearly know that 퐶퐶 | (푎푎푔푔/^2 - 1) will never be the case because 푟푟 is the smallest number with the property 퐶퐶 | (푎푎푔푔- 1) by definition.\n", 49 | "\n", 50 | "Now that we have established that 퐶퐶 | (푎푎푔푔/^2 - 1) (푎푎푔푔/^2 + 1) but is not divisible with either of the terms separately, it can only mean that one of the factor, 푝푝, divides (푎푎푔푔/^2 - 1) and another factor, 푞푞, divides (푎푎푔푔/^2 + 1).\n", 51 | "\n", 52 | "So, p will be a common divisor of 퐶퐶 and (푎푎푔푔/^2 - 1), and q will be a common divisor of 퐶퐶 and (푎푎푔푔/^2 +\n", 53 | "1). To get the values of 푝푝 and 푞푞, we simply need to find GCD( N , (푎푎푔푔/^2 - 1)) to get p and find GCD( N , (푎푎푔푔/^2 + 1)) to get 푞푞.\n", 54 | "\n", 55 | "\n", 56 | "\n", 57 | "In our example, since 푟푟 = 12 and 퐶퐶 = 35 ;\n", 58 | "then 푎푎푔푔/^2 - 1 = 312 /^2 - 1 = 728\n", 59 | "and 푎푎푔푔/^2 + 1 = 312 /^2 + 1 = 730.\n", 60 | "Therefore, 푝푝 = GCD(35, 728) = 7\n", 61 | "and 푞푞 = GCD(35, 730) = 5.\n", 62 | "\n", 63 | "\n", 64 | "If you have read all the steps carefully, you will find that Step 3 is the elephant in the room. Since in real world scenarios, N will be so large that it is impossible to calculate 푎푎푥푥푀푀 푓푓푑푑 퐶퐶 for 푥푥 ranging from 0 to Q -1 without waiting for billions of years even with the most powerful supercomputers. This is where quantum computers will come to our rescue.\n", 65 | "\n", 66 | "We have a quantum circuit that calculates 푎푎푥푥푀푀 푓푓푑푑 퐶퐶 for any given 푥푥. Though it is not easy to create such a circuit, it is possible because we know that any classical circuit can be converted to a quantum circuit using Toffoli gates. Instead of inputting each value of 푥푥 separately, we will give all the possible values of 푥푥 to the circuit by taking 푞푞 qubits and applying H gates on all of them. The input 푞푞 qubits will be in an equal superposition of |0⟩ to |푄푄− 1 ⟩. The bottom output qubits will be in a superposition of all the possible outputs |푎푎^0 푀푀푓푓푑푑 퐶퐶⟩ to |푎푎푄푄−1 푀푀푓푓푑푑 퐶퐶⟩.\n", 67 | "\n", 68 | "The system will be something like this (ignoring the normalization coefficients):\n", 69 | "|0⟩|푎푎^0 푀푀푓푓푑푑 퐶퐶⟩ + |1⟩|푎푎^1 푀푀푓푓푑푑 퐶퐶⟩ + |2⟩|푎푎^2 푀푀푓푓푑푑 퐶퐶⟩ ... |Q− 1 ⟩|푎푎푄푄−1 푀푀푓푓푑푑 퐶퐶⟩.\n", 70 | "\n", 71 | "Note that for multiple input qubit states there will be a common output state because 푎푎푥푥 푀푀푓푓푑푑 퐶퐶 is a many-to-one function. Now, if we go ahead and measure the output qubits, out of several superimposed outputs, only one of it will be obtained. Also, the input states will be affected in such a way that only those states that could result in the measured output can remain. The probabilities of all the other states will become zero.\n", 72 | "\n", 73 | "\n", 74 | "\n", 75 | "From Table 5.1, we can conclude that all the states that will be present in the input qubits will be separated by 푟푟. You must have noticed that we are closer to getting the answer because all we need is 푟푟 and we executed the circuit only once (exponential improvement must be obvious by now). But measuring the 푞푞 qubits will not help much because we don't have any pattern yet to exploit. Moreover, the first residue state might not be 0 and could be anything (called offset).\n", 76 | "\n", 77 | "Next, we do something called Inverse quantum Fourier Transform (QFT), it does the following:\n", 78 | " 1. It removes the offset and gives some probability for state 0\n", 79 | " 2. It changes the period between the states from 푟푟 to 푄푄/푟푟\n", 80 | "\n", 81 | "Now, if we measure the input 푞푞 qubits we are sure that we will get some multiple of 푄푄/푟푟 say 퐿퐿 ∗ 푄푄/푟푟. The value we measured is 푣푣, so we get the following equation:\n", 82 | "\n", 83 | "푣푣 = 퐿퐿 ∗ 푄푄/푟푟.\n", 84 | "\n", 85 | "Rewritten as\n", 86 | "푣푣/푄푄 = 퐿퐿(1/푟푟).\n", 87 | "\n", 88 | "Here, we know the values of 푣푣 and 푄푄. We can divide them until we get the smallest fraction. Now, the denominator will either be 푟푟 or a factor of 푟푟.\n", 89 | "\n", 90 | "Further details on QFT and the circuit implementation can be found here:\n", 91 | "\n", 92 | "https://en.wikipedia.org/wiki/Quantum_Fourier_transform\n", 93 | "\n", 94 | "The actual circuit for the 푎푎푥푥푀푀 푓푓푑푑 퐶퐶 is beyond the scope of this book and a dedicated reader can get some help over here:\n", 95 | "\n", 96 | "https://arxiv.org/abs/quant-ph/0205095" 97 | ] 98 | }, 99 | { 100 | "cell_type": "code", 101 | "execution_count": null, 102 | "metadata": {}, 103 | "outputs": [], 104 | "source": [] 105 | } 106 | ], 107 | "metadata": { 108 | "kernelspec": { 109 | "display_name": "Python 3.7.6 64-bit ('quantum': conda)", 110 | "name": "python37664bitquantumconda24f1e788a28742df87643f332a236def" 111 | }, 112 | "language_info": { 113 | "codemirror_mode": { 114 | "name": "ipython", 115 | "version": 3 116 | }, 117 | "file_extension": ".py", 118 | "mimetype": "text/x-python", 119 | "name": "python", 120 | "nbconvert_exporter": "python", 121 | "pygments_lexer": "ipython3", 122 | "version": "3.7.6-final" 123 | } 124 | }, 125 | "nbformat": 4, 126 | "nbformat_minor": 2 127 | } 128 | -------------------------------------------------------------------------------- /2-Quantum_Algorithms/1-Quantum_Oracles.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "markdown", 5 | "metadata": {}, 6 | "source": [ 7 | "# Phase 2 Quantum Algorithms\n", 8 | "\n", 9 | "## Pavan Kumar, Kitty Yeung\n", 10 | "\n", 11 | "In phase 1, we learned about the components of quantum computing – qubits, gates and\n", 12 | "measurements, which can be put together to form algorithms. An algorithm takes in information from\n", 13 | "qubit inputs, conducts a manipulation on the qubits, and then outputs desired results. We will be learning\n", 14 | "about a few algorithms that were developed as foundations to quantum computing logics in a historical\n", 15 | "order: Deutsch's algorithm, Deutsch-Jozsa algorithm, Grover's algorithm, Simon's algorithm and Shor's\n", 16 | "algorithm. These algorithms solve certain problems more efficiently than classical algorithms. (There are\n", 17 | "many other quantum algorithms. For the interested and curious readers, take a look at\n", 18 | "[http://quantumalgorithmzoo.org/](http://quantumalgorithmzoo.org/) ) Before going deeper into the algorithms, we need to start with a\n", 19 | "concept called \"Quantum Oracle\" which is an operation that is used as an input to another algorithm. In\n", 20 | "each session, we will practice our understanding with a Q# exercise.\n", 21 | "\n", 22 | "## 2.1 Quantum Oracles PHASE 2 Quantum Algorithms\n", 23 | "\n", 24 | "* [Q# exercise: Oracles](./2-Quantum_Algorithms/1-Quantum_Oracles.ipynb#qexercise)\n", 25 | "\n", 26 | "An oracle can be thought of as a black box that takes some inputs and gives some outputs. It can be\n", 27 | "represented using a circuit diagram below.\n", 28 | "\n", 29 | "![Figure 2.1.1](img/Figure211.png)\n", 30 | "\n", 31 | "_Figure 2.1.1 A generic oracle represented by a circuit diagram._\n", 32 | "\n", 33 | "As an example, this diagram can be an oracle that takes a three-bit integer and returns the reminder when\n", 34 | "it is divided by 4 with these possible outputs:\n", 35 | "\n", 36 | "\n", 37 | " \n", 38 | " \n", 39 | " \n", 40 | " \n", 41 | " \n", 42 | " \n", 43 | " \n", 44 | " \n", 45 | " \n", 46 | " \n", 47 | " \n", 48 | " \n", 49 | " \n", 50 | " \n", 51 | " \n", 52 | " \n", 53 | " \n", 54 | " \n", 55 | " \n", 56 | " \n", 57 | " \n", 58 | " \n", 59 | " \n", 60 | " \n", 61 | " \n", 62 | " \n", 63 | " \n", 64 | " \n", 65 | " \n", 66 | " \n", 67 | " \n", 68 | " \n", 69 | " \n", 70 | " \n", 71 | " \n", 72 | " \n", 73 | "
x       y = f(x) = x % 4    
0 0
1 1
2 2
3 3
4 0
5 1
6 2
7 3
\n", 74 | "\n", 75 | "_Table 2.1.1 Input and output table for a particular oracle as an example._\n", 76 | "\n", 77 | "We could build such a circuit using classical computing gates. But there are quantum algorithms\n", 78 | "proven to be more efficient than classical ones. We need a quantum oracle that can do the above function\n", 79 | "to build quantum algorithms, with a limitation that all the quantum gates need to be unitary (session 1.2).\n", 80 | "\n", 81 | "Let's say that the initial number is encoded in a 3-qubit quantum state, x. And the function f(x)\n", 82 | "is implemented as a unitary quantum gate A so that\n", 83 | "\n", 84 | "y = f(x) = Ax.\n", 85 | "\n", 86 | "Since A is unitary, A$^{−1}$ exists and it should be the same as A${^\\dagger}$. This implies\n", 87 | "\n", 88 | "A${^\\dagger}$(y) = A$^{−1}$(y) = A$^{−1}$(Ax) = x.\n", 89 | "\n", 90 | "This means that given any output, applying A${^\\dagger}$ should revert to the corresponding input. However, as seen\n", 91 | "in Table 2.1.1, both f(3) and f(7) equal to 3. Applying a unitary gate A${^\\dagger}$ on f(3) and f(7) would not\n", 92 | "return distinguishable results. Our assumption that such a matrix A can exist is wrong. This is a common\n", 93 | "problem for designing quantum oracles. Yet, there is a work-around if we use some extra qubits.\n", 94 | "\n", 95 | "For the same function, consider the following quantum circuit:\n", 96 | "\n", 97 | "![Figure 2.1.2](img/Figure212.png)\n", 98 | "\n", 99 | "_Figure 2.1.2 Quantum Oracle._\n", 100 | "\n", 101 | "Inputs x and y can contain multiple numbers of qubits. As one can see, this circuit leaves the input x intact,\n", 102 | "but it does an XOR on y with f(x) (in this example y = f(x) = x % 4). Here we are assuming that x and y are\n", 103 | "encoded using three qubits each. The size of the input state will therefore be 64 ( $2^6$ ). The dimension of\n", 104 | "the unitary matrix U will be 64 x 64. Don't worry about the exact contents of U right now. We are\n", 105 | "assuming that such a unitary matrix exists and test if we arrive at any contradictions.\n", 106 | "\n", 107 | "Let's evaluate this circuit for x= 3 = |011⟩, with y initialized to 0 = |000⟩ and refer to Table 2.1.1 for results of f(x):\n", 108 | "\n", 109 | "U( |011⟩, |000⟩ ) = ( |011⟩, |000⟩ $\\oplus$ F( |011⟩ ) ) = ( |011⟩, |000⟩ $\\oplus$ |011⟩ ) = ( |011⟩, |011⟩ ),\n", 110 | "\n", 111 | "It has the following circuit representation:\n", 112 | "\n", 113 | "![Figure oracle 011](img/oracle011.png)\n", 114 | "\n", 115 | "Since we have initialized y to 0, the output we need will be in the bottom 3 qubits (because y $\\oplus$ f(x) = f(x), if y = 0). \n", 116 | "Take the outputs of the above circuit and apply the same circuit again on them:\n", 117 | "\n", 118 | "U( |011⟩, |011⟩ ) = ( |011⟩, |011⟩ $\\oplus$ f( |011⟩ ) ) = ( |011⟩, |011⟩ $\\oplus$ |011⟩ ) = ( |011⟩, |000⟩ ).\n", 119 | "\n", 120 | "It has a circuit representation:\n", 121 | "\n", 122 | "![Figure oracle 011 again](img/oracle011again.png)\n", 123 | "\n", 124 | "This demonstrates that applying the same gate U on the outputs of the first circuit recovers the original inputs.\n", 125 | "\n", 126 | "Now, let's evaluate the quantum oracle for x = 7 = |111⟩, with y initialized to 0 = |000⟩ :\n", 127 | "\n", 128 | "U( |111⟩, |000⟩ ) = ( |111⟩, |000⟩ $\\oplus$ f( |111⟩ ) ) = ( |111⟩, |000⟩ $\\oplus$ |011⟩ ) = ( |111⟩, |011⟩ ).\n", 129 | "\n", 130 | "It has the following circuit representation:\n", 131 | "\n", 132 | "![Figure oracle 111](img/oracle111.png)\n", 133 | "\n", 134 | "Take the output of the circuit and apply the same circuit again,\n", 135 | "\n", 136 | "\n", 137 | "U ( |111⟩, |011⟩ ) = ( |111⟩, |011⟩ $\\oplus$ f( |111⟩ ) ) = ( |111⟩, |011⟩ $\\oplus$ |011⟩ ) = ( |111⟩, |000⟩ ),\n", 138 | "\n", 139 | "with this circuit representation:\n", 140 | "\n", 141 | "![Figure oracle 111 again](img/oracle111again.png)\n", 142 | "\n", 143 | "The original inputs are again recovered. And we can distinguish input results between f(3) and f(7).\n", 144 | "\n", 145 | "\n", 146 | "In fact, the circuit is designed in such a way that U is not only unitary but also its own inverse.\n", 147 | "\n", 148 | "U = U$^{−1}$.\n", 149 | "\n", 150 | "Applying the circuit back to back:\n", 151 | "\n", 152 | "\n", 153 | "U( U( |x⟩, |y⟩ ) ) = U( ( |x⟩, |y $\\oplus$ f(x)⟩ ) )\n", 154 | "\n", 155 | "\n", 156 | "= ( |x⟩, | (y $\\oplus$ f(x) ) $\\oplus$ f(x) ⟩ )\n", 157 | "\n", 158 | "\n", 159 | "= ( |x⟩, | y $\\oplus$ ( f(x) $\\oplus$ f(x) ) ⟩\n", 160 | "\n", 161 | "\n", 162 | "= ( |x⟩, | y $\\oplus$ 0 ⟩ ) = ( |x⟩, |y⟩ )\n", 163 | "\n", 164 | "![Figure oracles unitary](img/oracles_unitary.png)\n", 165 | "\n", 166 | "This proof is self-consistent. We can now create quantum oracles that are implemented using unitary\n", 167 | "gates that are self-inverse. We will be using these quantum oracles in many algorithms like Deutsch,\n", 168 | "Deutsch-Jozsa, Grover's algorithms, etc.\n", 169 | "\n", 170 | "### Q# exercise: Oracles\n ", 171 | "\n", 172 | "1. Go to the Quantum Katas: https://github.com/Microsoft/QuantumKatas.\n", 173 | "2. In Visual Studio (Code) open folder \"DeutschJoszaAlgorithm\" and Task.qs. Or use the Jupyter\n", 174 | " Notebook. Part 1 tasks focus on familiarize ourselves with oracles.\n" 175 | ] 176 | }, 177 | { 178 | "cell_type": "code", 179 | "execution_count": null, 180 | "metadata": {}, 181 | "outputs": [], 182 | "source": [] 183 | } 184 | ], 185 | "metadata": { 186 | "language_info": { 187 | "codemirror_mode": { 188 | "name": "ipython", 189 | "version": 3 190 | }, 191 | "file_extension": ".py", 192 | "mimetype": "text/x-python", 193 | "name": "python", 194 | "nbconvert_exporter": "python", 195 | "pygments_lexer": "ipython3", 196 | "version": "3.8.3-final" 197 | }, 198 | "orig_nbformat": 2, 199 | "kernelspec": { 200 | "name": "python38332bit225b1603132a4a1f9abff16033481403", 201 | "display_name": "Python 3.8.3 32-bit" 202 | } 203 | }, 204 | "nbformat": 4, 205 | "nbformat_minor": 2 206 | } -------------------------------------------------------------------------------- /2-Quantum_Algorithms/img/2_d_b0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/Reference-Guide-For-Quantum-Computing-A-Microsoft-Garage-Project/c1533b9472cbfe09b0e15a964d0c6fd73a8831fe/2-Quantum_Algorithms/img/2_d_b0.png -------------------------------------------------------------------------------- /2-Quantum_Algorithms/img/2_d_b1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/Reference-Guide-For-Quantum-Computing-A-Microsoft-Garage-Project/c1533b9472cbfe09b0e15a964d0c6fd73a8831fe/2-Quantum_Algorithms/img/2_d_b1.png -------------------------------------------------------------------------------- /2-Quantum_Algorithms/img/2_d_c0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/Reference-Guide-For-Quantum-Computing-A-Microsoft-Garage-Project/c1533b9472cbfe09b0e15a964d0c6fd73a8831fe/2-Quantum_Algorithms/img/2_d_c0.png -------------------------------------------------------------------------------- /2-Quantum_Algorithms/img/2_d_c1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/Reference-Guide-For-Quantum-Computing-A-Microsoft-Garage-Project/c1533b9472cbfe09b0e15a964d0c6fd73a8831fe/2-Quantum_Algorithms/img/2_d_c1.png -------------------------------------------------------------------------------- /2-Quantum_Algorithms/img/2_d_d.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/Reference-Guide-For-Quantum-Computing-A-Microsoft-Garage-Project/c1533b9472cbfe09b0e15a964d0c6fd73a8831fe/2-Quantum_Algorithms/img/2_d_d.png -------------------------------------------------------------------------------- /2-Quantum_Algorithms/img/2_d_d2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/Reference-Guide-For-Quantum-Computing-A-Microsoft-Garage-Project/c1533b9472cbfe09b0e15a964d0c6fd73a8831fe/2-Quantum_Algorithms/img/2_d_d2.png -------------------------------------------------------------------------------- /2-Quantum_Algorithms/img/2_d_d3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/Reference-Guide-For-Quantum-Computing-A-Microsoft-Garage-Project/c1533b9472cbfe09b0e15a964d0c6fd73a8831fe/2-Quantum_Algorithms/img/2_d_d3.png -------------------------------------------------------------------------------- /2-Quantum_Algorithms/img/2_d_d4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/Reference-Guide-For-Quantum-Computing-A-Microsoft-Garage-Project/c1533b9472cbfe09b0e15a964d0c6fd73a8831fe/2-Quantum_Algorithms/img/2_d_d4.png -------------------------------------------------------------------------------- /2-Quantum_Algorithms/img/2_d_d5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/Reference-Guide-For-Quantum-Computing-A-Microsoft-Garage-Project/c1533b9472cbfe09b0e15a964d0c6fd73a8831fe/2-Quantum_Algorithms/img/2_d_d5.png -------------------------------------------------------------------------------- /2-Quantum_Algorithms/img/2_d_deutsch.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/Reference-Guide-For-Quantum-Computing-A-Microsoft-Garage-Project/c1533b9472cbfe09b0e15a964d0c6fd73a8831fe/2-Quantum_Algorithms/img/2_d_deutsch.png -------------------------------------------------------------------------------- /2-Quantum_Algorithms/img/2_d_or.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/Reference-Guide-For-Quantum-Computing-A-Microsoft-Garage-Project/c1533b9472cbfe09b0e15a964d0c6fd73a8831fe/2-Quantum_Algorithms/img/2_d_or.png -------------------------------------------------------------------------------- /2-Quantum_Algorithms/img/2_d_sample01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/Reference-Guide-For-Quantum-Computing-A-Microsoft-Garage-Project/c1533b9472cbfe09b0e15a964d0c6fd73a8831fe/2-Quantum_Algorithms/img/2_d_sample01.png -------------------------------------------------------------------------------- /2-Quantum_Algorithms/img/2_d_sample01_code.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/Reference-Guide-For-Quantum-Computing-A-Microsoft-Garage-Project/c1533b9472cbfe09b0e15a964d0c6fd73a8831fe/2-Quantum_Algorithms/img/2_d_sample01_code.png -------------------------------------------------------------------------------- /2-Quantum_Algorithms/img/2_d_sample02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/Reference-Guide-For-Quantum-Computing-A-Microsoft-Garage-Project/c1533b9472cbfe09b0e15a964d0c6fd73a8831fe/2-Quantum_Algorithms/img/2_d_sample02.png -------------------------------------------------------------------------------- /2-Quantum_Algorithms/img/2_d_sample02_code.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/Reference-Guide-For-Quantum-Computing-A-Microsoft-Garage-Project/c1533b9472cbfe09b0e15a964d0c6fd73a8831fe/2-Quantum_Algorithms/img/2_d_sample02_code.png -------------------------------------------------------------------------------- /2-Quantum_Algorithms/img/3-dj001.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/Reference-Guide-For-Quantum-Computing-A-Microsoft-Garage-Project/c1533b9472cbfe09b0e15a964d0c6fd73a8831fe/2-Quantum_Algorithms/img/3-dj001.png -------------------------------------------------------------------------------- /2-Quantum_Algorithms/img/3-dj002.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/Reference-Guide-For-Quantum-Computing-A-Microsoft-Garage-Project/c1533b9472cbfe09b0e15a964d0c6fd73a8831fe/2-Quantum_Algorithms/img/3-dj002.png -------------------------------------------------------------------------------- /2-Quantum_Algorithms/img/3-dj003.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/Reference-Guide-For-Quantum-Computing-A-Microsoft-Garage-Project/c1533b9472cbfe09b0e15a964d0c6fd73a8831fe/2-Quantum_Algorithms/img/3-dj003.png -------------------------------------------------------------------------------- /2-Quantum_Algorithms/img/3-dj004.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/Reference-Guide-For-Quantum-Computing-A-Microsoft-Garage-Project/c1533b9472cbfe09b0e15a964d0c6fd73a8831fe/2-Quantum_Algorithms/img/3-dj004.png -------------------------------------------------------------------------------- /2-Quantum_Algorithms/img/3-dj005.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/Reference-Guide-For-Quantum-Computing-A-Microsoft-Garage-Project/c1533b9472cbfe09b0e15a964d0c6fd73a8831fe/2-Quantum_Algorithms/img/3-dj005.png -------------------------------------------------------------------------------- /2-Quantum_Algorithms/img/3-dj006.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/Reference-Guide-For-Quantum-Computing-A-Microsoft-Garage-Project/c1533b9472cbfe09b0e15a964d0c6fd73a8831fe/2-Quantum_Algorithms/img/3-dj006.png -------------------------------------------------------------------------------- /2-Quantum_Algorithms/img/4-g001.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/Reference-Guide-For-Quantum-Computing-A-Microsoft-Garage-Project/c1533b9472cbfe09b0e15a964d0c6fd73a8831fe/2-Quantum_Algorithms/img/4-g001.png -------------------------------------------------------------------------------- /2-Quantum_Algorithms/img/4-g0010.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/Reference-Guide-For-Quantum-Computing-A-Microsoft-Garage-Project/c1533b9472cbfe09b0e15a964d0c6fd73a8831fe/2-Quantum_Algorithms/img/4-g0010.png -------------------------------------------------------------------------------- /2-Quantum_Algorithms/img/4-g0011.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/Reference-Guide-For-Quantum-Computing-A-Microsoft-Garage-Project/c1533b9472cbfe09b0e15a964d0c6fd73a8831fe/2-Quantum_Algorithms/img/4-g0011.png -------------------------------------------------------------------------------- /2-Quantum_Algorithms/img/4-g0012.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/Reference-Guide-For-Quantum-Computing-A-Microsoft-Garage-Project/c1533b9472cbfe09b0e15a964d0c6fd73a8831fe/2-Quantum_Algorithms/img/4-g0012.png -------------------------------------------------------------------------------- /2-Quantum_Algorithms/img/4-g0013.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/Reference-Guide-For-Quantum-Computing-A-Microsoft-Garage-Project/c1533b9472cbfe09b0e15a964d0c6fd73a8831fe/2-Quantum_Algorithms/img/4-g0013.png -------------------------------------------------------------------------------- /2-Quantum_Algorithms/img/4-g0014.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/Reference-Guide-For-Quantum-Computing-A-Microsoft-Garage-Project/c1533b9472cbfe09b0e15a964d0c6fd73a8831fe/2-Quantum_Algorithms/img/4-g0014.png -------------------------------------------------------------------------------- /2-Quantum_Algorithms/img/4-g0015.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/Reference-Guide-For-Quantum-Computing-A-Microsoft-Garage-Project/c1533b9472cbfe09b0e15a964d0c6fd73a8831fe/2-Quantum_Algorithms/img/4-g0015.png -------------------------------------------------------------------------------- /2-Quantum_Algorithms/img/4-g0016.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/Reference-Guide-For-Quantum-Computing-A-Microsoft-Garage-Project/c1533b9472cbfe09b0e15a964d0c6fd73a8831fe/2-Quantum_Algorithms/img/4-g0016.png -------------------------------------------------------------------------------- /2-Quantum_Algorithms/img/4-g0017.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/Reference-Guide-For-Quantum-Computing-A-Microsoft-Garage-Project/c1533b9472cbfe09b0e15a964d0c6fd73a8831fe/2-Quantum_Algorithms/img/4-g0017.png -------------------------------------------------------------------------------- /2-Quantum_Algorithms/img/4-g0018.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/Reference-Guide-For-Quantum-Computing-A-Microsoft-Garage-Project/c1533b9472cbfe09b0e15a964d0c6fd73a8831fe/2-Quantum_Algorithms/img/4-g0018.png -------------------------------------------------------------------------------- /2-Quantum_Algorithms/img/4-g0019.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/Reference-Guide-For-Quantum-Computing-A-Microsoft-Garage-Project/c1533b9472cbfe09b0e15a964d0c6fd73a8831fe/2-Quantum_Algorithms/img/4-g0019.png -------------------------------------------------------------------------------- /2-Quantum_Algorithms/img/4-g002.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/Reference-Guide-For-Quantum-Computing-A-Microsoft-Garage-Project/c1533b9472cbfe09b0e15a964d0c6fd73a8831fe/2-Quantum_Algorithms/img/4-g002.png -------------------------------------------------------------------------------- /2-Quantum_Algorithms/img/4-g0020.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/Reference-Guide-For-Quantum-Computing-A-Microsoft-Garage-Project/c1533b9472cbfe09b0e15a964d0c6fd73a8831fe/2-Quantum_Algorithms/img/4-g0020.png -------------------------------------------------------------------------------- /2-Quantum_Algorithms/img/4-g0021.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/Reference-Guide-For-Quantum-Computing-A-Microsoft-Garage-Project/c1533b9472cbfe09b0e15a964d0c6fd73a8831fe/2-Quantum_Algorithms/img/4-g0021.png -------------------------------------------------------------------------------- /2-Quantum_Algorithms/img/4-g0022_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/Reference-Guide-For-Quantum-Computing-A-Microsoft-Garage-Project/c1533b9472cbfe09b0e15a964d0c6fd73a8831fe/2-Quantum_Algorithms/img/4-g0022_1.png -------------------------------------------------------------------------------- /2-Quantum_Algorithms/img/4-g0022_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/Reference-Guide-For-Quantum-Computing-A-Microsoft-Garage-Project/c1533b9472cbfe09b0e15a964d0c6fd73a8831fe/2-Quantum_Algorithms/img/4-g0022_2.png -------------------------------------------------------------------------------- /2-Quantum_Algorithms/img/4-g003.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/Reference-Guide-For-Quantum-Computing-A-Microsoft-Garage-Project/c1533b9472cbfe09b0e15a964d0c6fd73a8831fe/2-Quantum_Algorithms/img/4-g003.png -------------------------------------------------------------------------------- /2-Quantum_Algorithms/img/4-g0030.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/Reference-Guide-For-Quantum-Computing-A-Microsoft-Garage-Project/c1533b9472cbfe09b0e15a964d0c6fd73a8831fe/2-Quantum_Algorithms/img/4-g0030.png -------------------------------------------------------------------------------- /2-Quantum_Algorithms/img/4-g0031.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/Reference-Guide-For-Quantum-Computing-A-Microsoft-Garage-Project/c1533b9472cbfe09b0e15a964d0c6fd73a8831fe/2-Quantum_Algorithms/img/4-g0031.png -------------------------------------------------------------------------------- /2-Quantum_Algorithms/img/4-g0032.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/Reference-Guide-For-Quantum-Computing-A-Microsoft-Garage-Project/c1533b9472cbfe09b0e15a964d0c6fd73a8831fe/2-Quantum_Algorithms/img/4-g0032.png -------------------------------------------------------------------------------- /2-Quantum_Algorithms/img/4-g0033.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/Reference-Guide-For-Quantum-Computing-A-Microsoft-Garage-Project/c1533b9472cbfe09b0e15a964d0c6fd73a8831fe/2-Quantum_Algorithms/img/4-g0033.png -------------------------------------------------------------------------------- /2-Quantum_Algorithms/img/4-g0034.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/Reference-Guide-For-Quantum-Computing-A-Microsoft-Garage-Project/c1533b9472cbfe09b0e15a964d0c6fd73a8831fe/2-Quantum_Algorithms/img/4-g0034.png -------------------------------------------------------------------------------- /2-Quantum_Algorithms/img/4-g0035.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/Reference-Guide-For-Quantum-Computing-A-Microsoft-Garage-Project/c1533b9472cbfe09b0e15a964d0c6fd73a8831fe/2-Quantum_Algorithms/img/4-g0035.png -------------------------------------------------------------------------------- /2-Quantum_Algorithms/img/4-g0036.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/Reference-Guide-For-Quantum-Computing-A-Microsoft-Garage-Project/c1533b9472cbfe09b0e15a964d0c6fd73a8831fe/2-Quantum_Algorithms/img/4-g0036.png -------------------------------------------------------------------------------- /2-Quantum_Algorithms/img/4-g0037.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/Reference-Guide-For-Quantum-Computing-A-Microsoft-Garage-Project/c1533b9472cbfe09b0e15a964d0c6fd73a8831fe/2-Quantum_Algorithms/img/4-g0037.png -------------------------------------------------------------------------------- /2-Quantum_Algorithms/img/4-g0038.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/Reference-Guide-For-Quantum-Computing-A-Microsoft-Garage-Project/c1533b9472cbfe09b0e15a964d0c6fd73a8831fe/2-Quantum_Algorithms/img/4-g0038.png -------------------------------------------------------------------------------- /2-Quantum_Algorithms/img/4-g0039.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/Reference-Guide-For-Quantum-Computing-A-Microsoft-Garage-Project/c1533b9472cbfe09b0e15a964d0c6fd73a8831fe/2-Quantum_Algorithms/img/4-g0039.png -------------------------------------------------------------------------------- /2-Quantum_Algorithms/img/4-g004.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/Reference-Guide-For-Quantum-Computing-A-Microsoft-Garage-Project/c1533b9472cbfe09b0e15a964d0c6fd73a8831fe/2-Quantum_Algorithms/img/4-g004.png -------------------------------------------------------------------------------- /2-Quantum_Algorithms/img/4-g0040.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/Reference-Guide-For-Quantum-Computing-A-Microsoft-Garage-Project/c1533b9472cbfe09b0e15a964d0c6fd73a8831fe/2-Quantum_Algorithms/img/4-g0040.png -------------------------------------------------------------------------------- /2-Quantum_Algorithms/img/4-g0041.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/Reference-Guide-For-Quantum-Computing-A-Microsoft-Garage-Project/c1533b9472cbfe09b0e15a964d0c6fd73a8831fe/2-Quantum_Algorithms/img/4-g0041.png -------------------------------------------------------------------------------- /2-Quantum_Algorithms/img/4-g0042.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/Reference-Guide-For-Quantum-Computing-A-Microsoft-Garage-Project/c1533b9472cbfe09b0e15a964d0c6fd73a8831fe/2-Quantum_Algorithms/img/4-g0042.png -------------------------------------------------------------------------------- /2-Quantum_Algorithms/img/4-g0043.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/Reference-Guide-For-Quantum-Computing-A-Microsoft-Garage-Project/c1533b9472cbfe09b0e15a964d0c6fd73a8831fe/2-Quantum_Algorithms/img/4-g0043.png -------------------------------------------------------------------------------- /2-Quantum_Algorithms/img/4-g0044.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/Reference-Guide-For-Quantum-Computing-A-Microsoft-Garage-Project/c1533b9472cbfe09b0e15a964d0c6fd73a8831fe/2-Quantum_Algorithms/img/4-g0044.png -------------------------------------------------------------------------------- /2-Quantum_Algorithms/img/4-g0045.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/Reference-Guide-For-Quantum-Computing-A-Microsoft-Garage-Project/c1533b9472cbfe09b0e15a964d0c6fd73a8831fe/2-Quantum_Algorithms/img/4-g0045.png -------------------------------------------------------------------------------- /2-Quantum_Algorithms/img/4-g0046.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/Reference-Guide-For-Quantum-Computing-A-Microsoft-Garage-Project/c1533b9472cbfe09b0e15a964d0c6fd73a8831fe/2-Quantum_Algorithms/img/4-g0046.png -------------------------------------------------------------------------------- /2-Quantum_Algorithms/img/4-g0047.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/Reference-Guide-For-Quantum-Computing-A-Microsoft-Garage-Project/c1533b9472cbfe09b0e15a964d0c6fd73a8831fe/2-Quantum_Algorithms/img/4-g0047.png -------------------------------------------------------------------------------- /2-Quantum_Algorithms/img/4-g005.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/Reference-Guide-For-Quantum-Computing-A-Microsoft-Garage-Project/c1533b9472cbfe09b0e15a964d0c6fd73a8831fe/2-Quantum_Algorithms/img/4-g005.png -------------------------------------------------------------------------------- /2-Quantum_Algorithms/img/4-g006.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/Reference-Guide-For-Quantum-Computing-A-Microsoft-Garage-Project/c1533b9472cbfe09b0e15a964d0c6fd73a8831fe/2-Quantum_Algorithms/img/4-g006.png -------------------------------------------------------------------------------- /2-Quantum_Algorithms/img/4-g007.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/Reference-Guide-For-Quantum-Computing-A-Microsoft-Garage-Project/c1533b9472cbfe09b0e15a964d0c6fd73a8831fe/2-Quantum_Algorithms/img/4-g007.png -------------------------------------------------------------------------------- /2-Quantum_Algorithms/img/4-g008.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/Reference-Guide-For-Quantum-Computing-A-Microsoft-Garage-Project/c1533b9472cbfe09b0e15a964d0c6fd73a8831fe/2-Quantum_Algorithms/img/4-g008.png -------------------------------------------------------------------------------- /2-Quantum_Algorithms/img/4-g009.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/Reference-Guide-For-Quantum-Computing-A-Microsoft-Garage-Project/c1533b9472cbfe09b0e15a964d0c6fd73a8831fe/2-Quantum_Algorithms/img/4-g009.png -------------------------------------------------------------------------------- /2-Quantum_Algorithms/img/5-ex3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/Reference-Guide-For-Quantum-Computing-A-Microsoft-Garage-Project/c1533b9472cbfe09b0e15a964d0c6fd73a8831fe/2-Quantum_Algorithms/img/5-ex3.png -------------------------------------------------------------------------------- /2-Quantum_Algorithms/img/5-ex41.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/Reference-Guide-For-Quantum-Computing-A-Microsoft-Garage-Project/c1533b9472cbfe09b0e15a964d0c6fd73a8831fe/2-Quantum_Algorithms/img/5-ex41.png -------------------------------------------------------------------------------- /2-Quantum_Algorithms/img/5-ex42.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/Reference-Guide-For-Quantum-Computing-A-Microsoft-Garage-Project/c1533b9472cbfe09b0e15a964d0c6fd73a8831fe/2-Quantum_Algorithms/img/5-ex42.png -------------------------------------------------------------------------------- /2-Quantum_Algorithms/img/5-fig2.5.1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/Reference-Guide-For-Quantum-Computing-A-Microsoft-Garage-Project/c1533b9472cbfe09b0e15a964d0c6fd73a8831fe/2-Quantum_Algorithms/img/5-fig2.5.1.png -------------------------------------------------------------------------------- /2-Quantum_Algorithms/img/5-sac.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/Reference-Guide-For-Quantum-Computing-A-Microsoft-Garage-Project/c1533b9472cbfe09b0e15a964d0c6fd73a8831fe/2-Quantum_Algorithms/img/5-sac.png -------------------------------------------------------------------------------- /2-Quantum_Algorithms/img/6-g001.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/Reference-Guide-For-Quantum-Computing-A-Microsoft-Garage-Project/c1533b9472cbfe09b0e15a964d0c6fd73a8831fe/2-Quantum_Algorithms/img/6-g001.png -------------------------------------------------------------------------------- /2-Quantum_Algorithms/img/DJ_exercise1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/Reference-Guide-For-Quantum-Computing-A-Microsoft-Garage-Project/c1533b9472cbfe09b0e15a964d0c6fd73a8831fe/2-Quantum_Algorithms/img/DJ_exercise1.png -------------------------------------------------------------------------------- /2-Quantum_Algorithms/img/DJ_exercise2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/Reference-Guide-For-Quantum-Computing-A-Microsoft-Garage-Project/c1533b9472cbfe09b0e15a964d0c6fd73a8831fe/2-Quantum_Algorithms/img/DJ_exercise2.png -------------------------------------------------------------------------------- /2-Quantum_Algorithms/img/DJ_exercise3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/Reference-Guide-For-Quantum-Computing-A-Microsoft-Garage-Project/c1533b9472cbfe09b0e15a964d0c6fd73a8831fe/2-Quantum_Algorithms/img/DJ_exercise3.png -------------------------------------------------------------------------------- /2-Quantum_Algorithms/img/DJ_exercise4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/Reference-Guide-For-Quantum-Computing-A-Microsoft-Garage-Project/c1533b9472cbfe09b0e15a964d0c6fd73a8831fe/2-Quantum_Algorithms/img/DJ_exercise4.png -------------------------------------------------------------------------------- /2-Quantum_Algorithms/img/Deutsch_exercise1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/Reference-Guide-For-Quantum-Computing-A-Microsoft-Garage-Project/c1533b9472cbfe09b0e15a964d0c6fd73a8831fe/2-Quantum_Algorithms/img/Deutsch_exercise1.png -------------------------------------------------------------------------------- /2-Quantum_Algorithms/img/Deutsch_exercise2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/Reference-Guide-For-Quantum-Computing-A-Microsoft-Garage-Project/c1533b9472cbfe09b0e15a964d0c6fd73a8831fe/2-Quantum_Algorithms/img/Deutsch_exercise2.png -------------------------------------------------------------------------------- /2-Quantum_Algorithms/img/Deutsch_exercise3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/Reference-Guide-For-Quantum-Computing-A-Microsoft-Garage-Project/c1533b9472cbfe09b0e15a964d0c6fd73a8831fe/2-Quantum_Algorithms/img/Deutsch_exercise3.png -------------------------------------------------------------------------------- /2-Quantum_Algorithms/img/Deutsch_exercise4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/Reference-Guide-For-Quantum-Computing-A-Microsoft-Garage-Project/c1533b9472cbfe09b0e15a964d0c6fd73a8831fe/2-Quantum_Algorithms/img/Deutsch_exercise4.png -------------------------------------------------------------------------------- /2-Quantum_Algorithms/img/Figure211.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/Reference-Guide-For-Quantum-Computing-A-Microsoft-Garage-Project/c1533b9472cbfe09b0e15a964d0c6fd73a8831fe/2-Quantum_Algorithms/img/Figure211.png -------------------------------------------------------------------------------- /2-Quantum_Algorithms/img/Figure212.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/Reference-Guide-For-Quantum-Computing-A-Microsoft-Garage-Project/c1533b9472cbfe09b0e15a964d0c6fd73a8831fe/2-Quantum_Algorithms/img/Figure212.png -------------------------------------------------------------------------------- /2-Quantum_Algorithms/img/oracle011.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/Reference-Guide-For-Quantum-Computing-A-Microsoft-Garage-Project/c1533b9472cbfe09b0e15a964d0c6fd73a8831fe/2-Quantum_Algorithms/img/oracle011.png -------------------------------------------------------------------------------- /2-Quantum_Algorithms/img/oracle011again.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/Reference-Guide-For-Quantum-Computing-A-Microsoft-Garage-Project/c1533b9472cbfe09b0e15a964d0c6fd73a8831fe/2-Quantum_Algorithms/img/oracle011again.png -------------------------------------------------------------------------------- /2-Quantum_Algorithms/img/oracle111.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/Reference-Guide-For-Quantum-Computing-A-Microsoft-Garage-Project/c1533b9472cbfe09b0e15a964d0c6fd73a8831fe/2-Quantum_Algorithms/img/oracle111.png -------------------------------------------------------------------------------- /2-Quantum_Algorithms/img/oracle111again.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/Reference-Guide-For-Quantum-Computing-A-Microsoft-Garage-Project/c1533b9472cbfe09b0e15a964d0c6fd73a8831fe/2-Quantum_Algorithms/img/oracle111again.png -------------------------------------------------------------------------------- /2-Quantum_Algorithms/img/oracles_unitary.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/Reference-Guide-For-Quantum-Computing-A-Microsoft-Garage-Project/c1533b9472cbfe09b0e15a964d0c6fd73a8831fe/2-Quantum_Algorithms/img/oracles_unitary.png -------------------------------------------------------------------------------- /3-Quantum_Hardware_Systems/1-Natural_Qubits.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "markdown", 5 | "metadata": {}, 6 | "source": [ 7 | "\n", 8 | "**Phase 3 – Current Hardware Systems**\n", 9 | "\n", 10 | "**Kitty Yeung, Michael Beverland**\n", 11 | "\n", 12 | "To build a quantum computer, we need to have a physical system consisting of two values, to represent\n", 13 | "|0⟩ and |1⟩ states. Different from the two states (\"on\" and \"off\") built using a transistor in a classical\n", 14 | "computer, we also need to be able to put these states in superposition. There are natural systems that\n", 15 | "act as qubits, such as electrons with two different spin states; and there are systems we can artificially\n", 16 | "build to behave like qubits. We will explore a few approaches that have been pursued in academia and\n", 17 | "industry, each having pros and cons that we will briefly mention.\n", 18 | "\n", 19 | "The field is rapidly developing with hardware architectures changing as we speak. Therefore, we\n", 20 | "will not be comparing their widescale feasibility just yet. In addition, we are only highlighting the\n", 21 | "underlying principles here and do not delve into details of measurement and error corrections.\n", 22 | "\n", 23 | "# 3.1 Natural Qubits\n", 24 | "\n", 25 | "Let's start with the simplest example of a qubit. Otto Stern and Walther Gerlach created an experimental\n", 26 | "method in 1922 that helped discover a property of fundamental particles. This method was used to fire a\n", 27 | "beam of hydrogen atoms (each with a single electron, so effectively it was an electron beam) through a\n", 28 | "uniform magnetic field. It was assumed that the magnetic field would deviate the electron beam to one\n", 29 | "direction due to their negative charge. But surprisingly, two beams emerged. This unexpected outcome\n", 30 | "would only be possible if the elections possessed an intrinsic non-classical non-orbital angular momentum-a magnetic moment, which we call _spin_ , was discovered through this experiment.\n", 31 | "\n", 32 | "![Figure Stern-Gerlach experiment](image/Stern.png)\n", 33 | "\n", 34 | "The two beams in the Stern-Gerlach experiment are caused by two spin types of an electron. It\n", 35 | "can be calculated that there is a spin with magnitude $+\\frac{1}{2}\\hbar$ and another with $-\\frac{1}{2}\\hbar$ ( while $\\hbar$ is a constant\n", 36 | "number call the \"Planck constant\"). Graphically they can be represented on a sphere in 3D with its radius\n", 37 | "equals to $\\frac{\\sqrt{3}}{2}\\hbar$. Indicated by the directions projected onto the z-axis, they are simply called \"spin-up\" and\n", 38 | "\n", 39 | "\"spin-down\", each with spin value one-half. If we could isolate electrons and control their spins, we could\n", 40 | "make a qubit with one of the spins being state |0⟩ and the other |1⟩.\n", 41 | "\n", 42 | "![Frigure spin](image/spin.png)\n", 43 | "\n", 44 | ">_Physics insert – classical hardware_----------------------------------------------------------\n", 45 | ">\n", 46 | ">Modern classical computers are built on transistors, which are tiny switches\n", 47 | ">made of stacks of semiconductors, metals and insulators. Depending on the voltage\n", 48 | ">applied to the fate, electrical current can flow from source to drain, or not. Thus acting\n", 49 | ">like a switch flipping between \"on\" or \"off\", representing \"1\"s and \"0\"s.\n", 50 | ">\n", 51 | ">![Figure transistor](image/transistOr.png)\n", 52 | ">\n", 53 | ">This kind of operation does not allow any superposition of states. The building\n", 54 | ">blocks of quantum computers are very different.\n", 55 | "\n" 56 | ] 57 | }, 58 | { 59 | "cell_type": "code", 60 | "execution_count": null, 61 | "metadata": {}, 62 | "outputs": [], 63 | "source": [] 64 | } 65 | ], 66 | "metadata": { 67 | "language_info": { 68 | "codemirror_mode": { 69 | "name": "ipython", 70 | "version": 3 71 | }, 72 | "file_extension": ".py", 73 | "mimetype": "text/x-python", 74 | "name": "python", 75 | "nbconvert_exporter": "python", 76 | "pygments_lexer": "ipython3", 77 | "version": "3.8.3-final" 78 | }, 79 | "orig_nbformat": 2, 80 | "kernelspec": { 81 | "name": "python38332bit225b1603132a4a1f9abff16033481403", 82 | "display_name": "Python 3.8.3 32-bit" 83 | } 84 | }, 85 | "nbformat": 4, 86 | "nbformat_minor": 2 87 | } -------------------------------------------------------------------------------- /3-Quantum_Hardware_Systems/2-Silicon_Quantum_Dots.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "markdown", 5 | "metadata": {}, 6 | "source": [ 7 | "## 3.2 Silicon quantum dots\n", 8 | "\n", 9 | "A quantum dot is a way to trap a single electron in a controllable manner. It is achieved by confining\n", 10 | "electrons in the 0th dimension (0D). The following shows possible dimensionalities electrons can occupy.\n", 11 | "A 0D scenario is not easily found in natural materials but we can create an artificial trap in a semiconductor.\n", 12 | "\n", 13 | "![Figure dimensions](image/dimensions.png) \n", 14 | "\n", 15 | "_These graphics are a simplification that describes dimensionalities for electrons to occupy. In an actual\n", 16 | "material, there are also nuclei inside atoms and defects in the crystal lattices, but we are only drawing\n", 17 | "the presence of electrons._\n", 18 | "\n", 19 | "To make a quantum dot, we can start from 2D. Electrons can be confined into a plane at the\n", 20 | "interface between two semiconducting materials grown in laboratories and fabrication facilities, because\n", 21 | "they are not natural. Such an electron plane is called a 2D electron gas (2DEG).\n", 22 | "\n", 23 | "![Figure 2DEG](image/2DEG.png)\n", 24 | "\n", 25 | "_AlGaAs and GaAs are examples of two commonly used semiconductors for making a 2DEG. The search\n", 26 | "for the best materials for quantum dot quantum computing is an ongoing effort._\n", 27 | "\n", 28 | "\n", 29 | "Next, we can deposit some metal structures above the 2DEG. By applying appropriate voltages to\n", 30 | "the metals, electrons underneath can be removed. This process is called \"depletion\". We can create all\n", 31 | "kinds of shapes for the metals, forming little islands in the 2DEG where electrons can be depleted one by\n", 32 | "one until only one electron is left in an island.\n", 33 | "\n", 34 | "![Figure quantum dot](image/2DEG_quantum_dot.png) \n", 35 | "\n", 36 | "_Cross-sectional view and top view of a quantum dot._\n", 37 | "\n", 38 | "This is our electron trap. The electron acts as a qubit whose spin defines its state. It can be\n", 39 | "manipulated with magnetic or electric fields applied from the electrodes. To have multiple qubits, several\n", 40 | "traps can be created next to one another. The magnetic dipole interaction between nearby electrons\n", 41 | "allows them to couple and entangle.\n", 42 | "\n", 43 | "![Figure quantum dot](image/two_quantum_dots.png) \n", 44 | "\n", 45 | ">_Physics insert – artificial atom_ --------------------------------------------------------------------------\n", 46 | ">\n", 47 | ">Quantum dots are one of the \"artificial atoms\" we can engineer. A natural atom has a\n", 48 | ">nucleus bounding electrons to their orbits. Mimicking the bounding of electrons,\n", 49 | ">quantum dots behave like atoms.\n", 50 | ">Some of the methods of producing qubits in the following sessions, such as\n", 51 | ">making crystal defects and superconducting circuits, can also be considered as creating\n", 52 | ">\"artificial atoms\". A defect in a crystal lattice can act like a nucleus trapping an electron\n", 53 | ">introduced by a foreign atom. A superconducting circuit has energy levels reminiscent\n", 54 | ">of the energy levels of electrons inside an atom, even though the circuit does not have\n", 55 | ">direct analogies of electrons and nucleus.\n", 56 | ">In fact, we can find many systems in the universe behaving in similar ways, by\n", 57 | ">looking at their mathematical descriptions. For example, comparing the energy\n", 58 | ">equations of an oscillating circuit and a pendulum and the Schrödinger equation of a\n", 59 | ">hydrogen atom, the equations have the same form and we can see parameters that\n", 60 | ">appear at the same locations of these equations. They are counterparts in\n", 61 | ">electromagnetism, mechanics and quantum mechanics. Thus, by grasping the\n", 62 | ">similarities, we can make an electromagnetic pendulum or a qubit in a solid-state\n", 63 | ">circuit, which do not directly occur in nature. See the sections on crystal defects and\n", 64 | ">superconducting circuits for details.\n", 65 | ">\n", 66 | ">Below summarizes the very similar [Hamiltonians](https://en.wikipedia.org/wiki/Hamiltonian_(quantum_mechanics)), H, of several seemingly\n", 67 | ">different systems. Compare the mass on a spring with the classical LC circuit or the\n", 68 | ">pendulum with the superconducting circuit.\n", 69 | ">\n", 70 | ">\n", 71 | ">![Figure Hamiltonian](image/Hamiltonian.png)\n", 72 | ">\n", 73 | ">_Top down: pendulum, mass on a spring, classical and quantum LC circuit,\n", 74 | ">superconducting circuit, atom (all lossless, no resistance, friction, etc.)_\n", 75 | ">\n", 76 | ">To elaborate more on the beauty of finding patterns in the universe, the\n", 77 | ">Maxwell's equations, for example, allow us to see that light behaves as an\n", 78 | ">electromagnetic wave with a constant speed of propagation, $c=\\sqrt{\\epsilon_0\\mu_0}$. We are using\n", 79 | ">electromagnetic waves or light throughout Phase 3 as the method to control and\n", 80 | ">manipulate qubits.\n", 81 | ">\n", 82 | ">![Figure Maxwell](image/Maxwell.png)\n", 83 | ">\n", 84 | ">The symmetry in the Maxwell's equations is also how Einstein was able to formulate\n", 85 | ">the special theory of relativity in 1905 and discover the famous energy and mass\n", 86 | ">relation $E=mc^2$.\n", 87 | ">\n", 88 | ">![Figure Einstein](image/Einstein.png)\n", 89 | ">\n" 90 | ] 91 | }, 92 | { 93 | "cell_type": "code", 94 | "execution_count": null, 95 | "metadata": {}, 96 | "outputs": [], 97 | "source": [] 98 | } 99 | ], 100 | "metadata": { 101 | "language_info": { 102 | "codemirror_mode": { 103 | "name": "ipython", 104 | "version": 3 105 | }, 106 | "file_extension": ".py", 107 | "mimetype": "text/x-python", 108 | "name": "python", 109 | "nbconvert_exporter": "python", 110 | "pygments_lexer": "ipython3", 111 | "version": "3.8.3-final" 112 | }, 113 | "orig_nbformat": 2, 114 | "kernelspec": { 115 | "name": "python38332bit225b1603132a4a1f9abff16033481403", 116 | "display_name": "Python 3.8.3 32-bit" 117 | } 118 | }, 119 | "nbformat": 4, 120 | "nbformat_minor": 2 121 | } -------------------------------------------------------------------------------- /3-Quantum_Hardware_Systems/3-Crystal_Defects.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "markdown", 5 | "metadata": {}, 6 | "source": [ 7 | "## 3.3 Crystal defects\n", 8 | "\n", 9 | "We can also trap electrons in crystal lattices, such as diamond or silicon. Imagine a carbon atom (which\n", 10 | "has six electrons) inside diamond is replaced by a nitrogen atom (which has seven electrons). The nitrogen\n", 11 | "atom introduces a vacancy and an extra electron to the lattice. This electron is bound to the nitrogen-\n", 12 | "vacancy region (called the \"NV center\"). Its spin can be manipulated with a focused laser light – an\n", 13 | "electromagnetic field. Qubits made from crystal defects can be isolated from noise. But practically it is\n", 14 | "hard to scale due to difficulty in growing crystal defects in the lab.\n", 15 | "\n", 16 | "![Figure vacancy](image/vacancy.png)" 17 | ] 18 | }, 19 | { 20 | "cell_type": "code", 21 | "execution_count": null, 22 | "metadata": {}, 23 | "outputs": [], 24 | "source": [] 25 | } 26 | ], 27 | "metadata": { 28 | "language_info": { 29 | "codemirror_mode": { 30 | "name": "ipython", 31 | "version": 3 32 | }, 33 | "file_extension": ".py", 34 | "mimetype": "text/x-python", 35 | "name": "python", 36 | "nbconvert_exporter": "python", 37 | "pygments_lexer": "ipython3", 38 | "version": "3.8.3-final" 39 | }, 40 | "orig_nbformat": 2, 41 | "kernelspec": { 42 | "name": "python38332bit225b1603132a4a1f9abff16033481403", 43 | "display_name": "Python 3.8.3 32-bit" 44 | } 45 | }, 46 | "nbformat": 4, 47 | "nbformat_minor": 2 48 | } -------------------------------------------------------------------------------- /3-Quantum_Hardware_Systems/4-Trapped_Ions.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "markdown", 5 | "metadata": {}, 6 | "source": [ 7 | "## 3.4 Trapped ions\n", 8 | "\n", 9 | "![text](image/ion.png)\n", 10 | "\n", 11 | "Another way to utilize electron spin is by controlling ions. An ion is formed by removing or adding electrons\n", 12 | "to an atom. This is called ionization. If we have one extra or one fewer electron, we can have an effective\n", 13 | "spin up or spin down. We can then apply an electro-magnetic field to trap the ions into a row in a vacuum.\n", 14 | "Their spin will align with the magnetic field initially.\n", 15 | "\n", 16 | "![text](image/ion_trap_laser_line.png)\n", 17 | "\n", 18 | "In a simplified picture, each ion acts as a qubit. By illuminating focused laser beams onto individual\n", 19 | "ions, we can tweak their spins to point in a different direction, hence manipulating the qubit state. This is\n", 20 | "because lasers emit electro-magnetic waves, which generates forces to move the ions.\n", 21 | "\n", 22 | "![text](image/ion_trap_laser_beam.png)\n", 23 | "\n", 24 | "In fact, the interaction between the laser light and the ions is quite a bit more complex. Electrons\n", 25 | "bound by atoms or ions are not free floating. There are discrete sets of energy levels for electrons to\n", 26 | "occupy. Because electrons have spin, certain energy levels are for spin up electrons while others are for\n", 27 | "spin down electrons. The set of energy levels to accommodate electron spins is called a _fine structure_ of\n", 28 | "an atom or ion. There are also electromagnetic interactions between the electrons and nucleus. Some\n", 29 | "energy levels further split. This is called a _hyperfine structure_. In trapped-ion quantum computing systems,\n", 30 | "the fine structures are used as the qubit |0⟩ and |1⟩ states and the hyperfine structure is used to aid\n", 31 | "transition between the states.\n", 32 | "\n", 33 | "What the focused laser light does is not only moving the ions by force, it also can give electrons a\n", 34 | "certain energy to enable transition from one energy level to another, effectively rotating the spin. That's\n", 35 | "why the picture above shows a displacement of the ion's position as well as a spin flip. The gate operations\n", 36 | "and entanglement are achieved by manipulating each ion with individual laser beams and letting nearby\n", 37 | "ions interact through their electrons' spins and physical displacement. Note this is still a much-simplified\n", 38 | "explanation.\n", 39 | "\n", 40 | "![text](image/fine_structure.png)\n", 41 | "\n", 42 | "While trapping and manipulating ions in vacuum provides a \"clean\" way to create qubits, the\n", 43 | "complex optical setup is very difficult to scale. Current state-of -the-art of the number of ions that can be\n", 44 | "trapped is around 20." 45 | ] 46 | }, 47 | { 48 | "cell_type": "code", 49 | "execution_count": null, 50 | "metadata": {}, 51 | "outputs": [], 52 | "source": [] 53 | } 54 | ], 55 | "metadata": { 56 | "language_info": { 57 | "codemirror_mode": { 58 | "name": "ipython", 59 | "version": 3 60 | }, 61 | "file_extension": ".py", 62 | "mimetype": "text/x-python", 63 | "name": "python", 64 | "nbconvert_exporter": "python", 65 | "pygments_lexer": "ipython3", 66 | "version": "3.8.3-final" 67 | }, 68 | "orig_nbformat": 2, 69 | "kernelspec": { 70 | "name": "python38364bitnbcondaaa7c644822a049159278fba6858d45ff", 71 | "display_name": "Python 3.8.3 64-bit ('nb': conda)" 72 | } 73 | }, 74 | "nbformat": 4, 75 | "nbformat_minor": 2 76 | } -------------------------------------------------------------------------------- /3-Quantum_Hardware_Systems/image/2DEG.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/Reference-Guide-For-Quantum-Computing-A-Microsoft-Garage-Project/c1533b9472cbfe09b0e15a964d0c6fd73a8831fe/3-Quantum_Hardware_Systems/image/2DEG.png -------------------------------------------------------------------------------- /3-Quantum_Hardware_Systems/image/2DEG_quantum_dot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/Reference-Guide-For-Quantum-Computing-A-Microsoft-Garage-Project/c1533b9472cbfe09b0e15a964d0c6fd73a8831fe/3-Quantum_Hardware_Systems/image/2DEG_quantum_dot.png -------------------------------------------------------------------------------- /3-Quantum_Hardware_Systems/image/Cooper_pair.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/Reference-Guide-For-Quantum-Computing-A-Microsoft-Garage-Project/c1533b9472cbfe09b0e15a964d0c6fd73a8831fe/3-Quantum_Hardware_Systems/image/Cooper_pair.png -------------------------------------------------------------------------------- /3-Quantum_Hardware_Systems/image/Einstein.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/Reference-Guide-For-Quantum-Computing-A-Microsoft-Garage-Project/c1533b9472cbfe09b0e15a964d0c6fd73a8831fe/3-Quantum_Hardware_Systems/image/Einstein.png -------------------------------------------------------------------------------- /3-Quantum_Hardware_Systems/image/Hamiltonian.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/Reference-Guide-For-Quantum-Computing-A-Microsoft-Garage-Project/c1533b9472cbfe09b0e15a964d0c6fd73a8831fe/3-Quantum_Hardware_Systems/image/Hamiltonian.png -------------------------------------------------------------------------------- /3-Quantum_Hardware_Systems/image/Ising model.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/Reference-Guide-For-Quantum-Computing-A-Microsoft-Garage-Project/c1533b9472cbfe09b0e15a964d0c6fd73a8831fe/3-Quantum_Hardware_Systems/image/Ising model.png -------------------------------------------------------------------------------- /3-Quantum_Hardware_Systems/image/LC_circuit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/Reference-Guide-For-Quantum-Computing-A-Microsoft-Garage-Project/c1533b9472cbfe09b0e15a964d0c6fd73a8831fe/3-Quantum_Hardware_Systems/image/LC_circuit.png -------------------------------------------------------------------------------- /3-Quantum_Hardware_Systems/image/LC_energies.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/Reference-Guide-For-Quantum-Computing-A-Microsoft-Garage-Project/c1533b9472cbfe09b0e15a964d0c6fd73a8831fe/3-Quantum_Hardware_Systems/image/LC_energies.png -------------------------------------------------------------------------------- /3-Quantum_Hardware_Systems/image/LC_quantum.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/Reference-Guide-For-Quantum-Computing-A-Microsoft-Garage-Project/c1533b9472cbfe09b0e15a964d0c6fd73a8831fe/3-Quantum_Hardware_Systems/image/LC_quantum.png -------------------------------------------------------------------------------- /3-Quantum_Hardware_Systems/image/Majorana_pairs.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/Reference-Guide-For-Quantum-Computing-A-Microsoft-Garage-Project/c1533b9472cbfe09b0e15a964d0c6fd73a8831fe/3-Quantum_Hardware_Systems/image/Majorana_pairs.png -------------------------------------------------------------------------------- /3-Quantum_Hardware_Systems/image/Majorana_pairs_0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/Reference-Guide-For-Quantum-Computing-A-Microsoft-Garage-Project/c1533b9472cbfe09b0e15a964d0c6fd73a8831fe/3-Quantum_Hardware_Systems/image/Majorana_pairs_0.png -------------------------------------------------------------------------------- /3-Quantum_Hardware_Systems/image/Majorana_pairs_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/Reference-Guide-For-Quantum-Computing-A-Microsoft-Garage-Project/c1533b9472cbfe09b0e15a964d0c6fd73a8831fe/3-Quantum_Hardware_Systems/image/Majorana_pairs_1.png -------------------------------------------------------------------------------- /3-Quantum_Hardware_Systems/image/Majorana_pairs_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/Reference-Guide-For-Quantum-Computing-A-Microsoft-Garage-Project/c1533b9472cbfe09b0e15a964d0c6fd73a8831fe/3-Quantum_Hardware_Systems/image/Majorana_pairs_2.png -------------------------------------------------------------------------------- /3-Quantum_Hardware_Systems/image/Maxwell.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/Reference-Guide-For-Quantum-Computing-A-Microsoft-Garage-Project/c1533b9472cbfe09b0e15a964d0c6fd73a8831fe/3-Quantum_Hardware_Systems/image/Maxwell.png -------------------------------------------------------------------------------- /3-Quantum_Hardware_Systems/image/Stern.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/Reference-Guide-For-Quantum-Computing-A-Microsoft-Garage-Project/c1533b9472cbfe09b0e15a964d0c6fd73a8831fe/3-Quantum_Hardware_Systems/image/Stern.png -------------------------------------------------------------------------------- /3-Quantum_Hardware_Systems/image/Superconducting_gap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/Reference-Guide-For-Quantum-Computing-A-Microsoft-Garage-Project/c1533b9472cbfe09b0e15a964d0c6fd73a8831fe/3-Quantum_Hardware_Systems/image/Superconducting_gap.png -------------------------------------------------------------------------------- /3-Quantum_Hardware_Systems/image/T_junction.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/Reference-Guide-For-Quantum-Computing-A-Microsoft-Garage-Project/c1533b9472cbfe09b0e15a964d0c6fd73a8831fe/3-Quantum_Hardware_Systems/image/T_junction.png -------------------------------------------------------------------------------- /3-Quantum_Hardware_Systems/image/abelian.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/Reference-Guide-For-Quantum-Computing-A-Microsoft-Garage-Project/c1533b9472cbfe09b0e15a964d0c6fd73a8831fe/3-Quantum_Hardware_Systems/image/abelian.png -------------------------------------------------------------------------------- /3-Quantum_Hardware_Systems/image/bosons_fermions.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/Reference-Guide-For-Quantum-Computing-A-Microsoft-Garage-Project/c1533b9472cbfe09b0e15a964d0c6fd73a8831fe/3-Quantum_Hardware_Systems/image/bosons_fermions.png -------------------------------------------------------------------------------- /3-Quantum_Hardware_Systems/image/braiding.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/Reference-Guide-For-Quantum-Computing-A-Microsoft-Garage-Project/c1533b9472cbfe09b0e15a964d0c6fd73a8831fe/3-Quantum_Hardware_Systems/image/braiding.png -------------------------------------------------------------------------------- /3-Quantum_Hardware_Systems/image/braiding_H_gate.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/Reference-Guide-For-Quantum-Computing-A-Microsoft-Garage-Project/c1533b9472cbfe09b0e15a964d0c6fd73a8831fe/3-Quantum_Hardware_Systems/image/braiding_H_gate.png -------------------------------------------------------------------------------- /3-Quantum_Hardware_Systems/image/braiding_X_gate.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/Reference-Guide-For-Quantum-Computing-A-Microsoft-Garage-Project/c1533b9472cbfe09b0e15a964d0c6fd73a8831fe/3-Quantum_Hardware_Systems/image/braiding_X_gate.png -------------------------------------------------------------------------------- /3-Quantum_Hardware_Systems/image/braiding_Z_gate.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/Reference-Guide-For-Quantum-Computing-A-Microsoft-Garage-Project/c1533b9472cbfe09b0e15a964d0c6fd73a8831fe/3-Quantum_Hardware_Systems/image/braiding_Z_gate.png -------------------------------------------------------------------------------- /3-Quantum_Hardware_Systems/image/chemical_potential.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/Reference-Guide-For-Quantum-Computing-A-Microsoft-Garage-Project/c1533b9472cbfe09b0e15a964d0c6fd73a8831fe/3-Quantum_Hardware_Systems/image/chemical_potential.png -------------------------------------------------------------------------------- /3-Quantum_Hardware_Systems/image/coherence.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/Reference-Guide-For-Quantum-Computing-A-Microsoft-Garage-Project/c1533b9472cbfe09b0e15a964d0c6fd73a8831fe/3-Quantum_Hardware_Systems/image/coherence.png -------------------------------------------------------------------------------- /3-Quantum_Hardware_Systems/image/conductance.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/Reference-Guide-For-Quantum-Computing-A-Microsoft-Garage-Project/c1533b9472cbfe09b0e15a964d0c6fd73a8831fe/3-Quantum_Hardware_Systems/image/conductance.png -------------------------------------------------------------------------------- /3-Quantum_Hardware_Systems/image/conductor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/Reference-Guide-For-Quantum-Computing-A-Microsoft-Garage-Project/c1533b9472cbfe09b0e15a964d0c6fd73a8831fe/3-Quantum_Hardware_Systems/image/conductor.png -------------------------------------------------------------------------------- /3-Quantum_Hardware_Systems/image/dilution_fridge.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/Reference-Guide-For-Quantum-Computing-A-Microsoft-Garage-Project/c1533b9472cbfe09b0e15a964d0c6fd73a8831fe/3-Quantum_Hardware_Systems/image/dilution_fridge.png -------------------------------------------------------------------------------- /3-Quantum_Hardware_Systems/image/dimensions.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/Reference-Guide-For-Quantum-Computing-A-Microsoft-Garage-Project/c1533b9472cbfe09b0e15a964d0c6fd73a8831fe/3-Quantum_Hardware_Systems/image/dimensions.png -------------------------------------------------------------------------------- /3-Quantum_Hardware_Systems/image/fine_structure.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/Reference-Guide-For-Quantum-Computing-A-Microsoft-Garage-Project/c1533b9472cbfe09b0e15a964d0c6fd73a8831fe/3-Quantum_Hardware_Systems/image/fine_structure.png -------------------------------------------------------------------------------- /3-Quantum_Hardware_Systems/image/fusion_rule.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/Reference-Guide-For-Quantum-Computing-A-Microsoft-Garage-Project/c1533b9472cbfe09b0e15a964d0c6fd73a8831fe/3-Quantum_Hardware_Systems/image/fusion_rule.png -------------------------------------------------------------------------------- /3-Quantum_Hardware_Systems/image/fusion_rules.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/Reference-Guide-For-Quantum-Computing-A-Microsoft-Garage-Project/c1533b9472cbfe09b0e15a964d0c6fd73a8831fe/3-Quantum_Hardware_Systems/image/fusion_rules.png -------------------------------------------------------------------------------- /3-Quantum_Hardware_Systems/image/heating_noise.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/Reference-Guide-For-Quantum-Computing-A-Microsoft-Garage-Project/c1533b9472cbfe09b0e15a964d0c6fd73a8831fe/3-Quantum_Hardware_Systems/image/heating_noise.png -------------------------------------------------------------------------------- /3-Quantum_Hardware_Systems/image/ion.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/Reference-Guide-For-Quantum-Computing-A-Microsoft-Garage-Project/c1533b9472cbfe09b0e15a964d0c6fd73a8831fe/3-Quantum_Hardware_Systems/image/ion.png -------------------------------------------------------------------------------- /3-Quantum_Hardware_Systems/image/ion_trap_laser_beam.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/Reference-Guide-For-Quantum-Computing-A-Microsoft-Garage-Project/c1533b9472cbfe09b0e15a964d0c6fd73a8831fe/3-Quantum_Hardware_Systems/image/ion_trap_laser_beam.png -------------------------------------------------------------------------------- /3-Quantum_Hardware_Systems/image/ion_trap_laser_line.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/Reference-Guide-For-Quantum-Computing-A-Microsoft-Garage-Project/c1533b9472cbfe09b0e15a964d0c6fd73a8831fe/3-Quantum_Hardware_Systems/image/ion_trap_laser_line.png -------------------------------------------------------------------------------- /3-Quantum_Hardware_Systems/image/josephson_junction.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/Reference-Guide-For-Quantum-Computing-A-Microsoft-Garage-Project/c1533b9472cbfe09b0e15a964d0c6fd73a8831fe/3-Quantum_Hardware_Systems/image/josephson_junction.png -------------------------------------------------------------------------------- /3-Quantum_Hardware_Systems/image/quantum_dot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/Reference-Guide-For-Quantum-Computing-A-Microsoft-Garage-Project/c1533b9472cbfe09b0e15a964d0c6fd73a8831fe/3-Quantum_Hardware_Systems/image/quantum_dot.png -------------------------------------------------------------------------------- /3-Quantum_Hardware_Systems/image/quantum_dot_top.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/Reference-Guide-For-Quantum-Computing-A-Microsoft-Garage-Project/c1533b9472cbfe09b0e15a964d0c6fd73a8831fe/3-Quantum_Hardware_Systems/image/quantum_dot_top.png -------------------------------------------------------------------------------- /3-Quantum_Hardware_Systems/image/quasiparticle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/Reference-Guide-For-Quantum-Computing-A-Microsoft-Garage-Project/c1533b9472cbfe09b0e15a964d0c6fd73a8831fe/3-Quantum_Hardware_Systems/image/quasiparticle.png -------------------------------------------------------------------------------- /3-Quantum_Hardware_Systems/image/resistance.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/Reference-Guide-For-Quantum-Computing-A-Microsoft-Garage-Project/c1533b9472cbfe09b0e15a964d0c6fd73a8831fe/3-Quantum_Hardware_Systems/image/resistance.jpg -------------------------------------------------------------------------------- /3-Quantum_Hardware_Systems/image/resistance.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/Reference-Guide-For-Quantum-Computing-A-Microsoft-Garage-Project/c1533b9472cbfe09b0e15a964d0c6fd73a8831fe/3-Quantum_Hardware_Systems/image/resistance.png -------------------------------------------------------------------------------- /3-Quantum_Hardware_Systems/image/spin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/Reference-Guide-For-Quantum-Computing-A-Microsoft-Garage-Project/c1533b9472cbfe09b0e15a964d0c6fd73a8831fe/3-Quantum_Hardware_Systems/image/spin.png -------------------------------------------------------------------------------- /3-Quantum_Hardware_Systems/image/superconducting.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/Reference-Guide-For-Quantum-Computing-A-Microsoft-Garage-Project/c1533b9472cbfe09b0e15a964d0c6fd73a8831fe/3-Quantum_Hardware_Systems/image/superconducting.png -------------------------------------------------------------------------------- /3-Quantum_Hardware_Systems/image/superconductor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/Reference-Guide-For-Quantum-Computing-A-Microsoft-Garage-Project/c1533b9472cbfe09b0e15a964d0c6fd73a8831fe/3-Quantum_Hardware_Systems/image/superconductor.png -------------------------------------------------------------------------------- /3-Quantum_Hardware_Systems/image/topological_qubit_0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/Reference-Guide-For-Quantum-Computing-A-Microsoft-Garage-Project/c1533b9472cbfe09b0e15a964d0c6fd73a8831fe/3-Quantum_Hardware_Systems/image/topological_qubit_0.png -------------------------------------------------------------------------------- /3-Quantum_Hardware_Systems/image/topological_qubit_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/Reference-Guide-For-Quantum-Computing-A-Microsoft-Garage-Project/c1533b9472cbfe09b0e15a964d0c6fd73a8831fe/3-Quantum_Hardware_Systems/image/topological_qubit_1.png -------------------------------------------------------------------------------- /3-Quantum_Hardware_Systems/image/topology.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/Reference-Guide-For-Quantum-Computing-A-Microsoft-Garage-Project/c1533b9472cbfe09b0e15a964d0c6fd73a8831fe/3-Quantum_Hardware_Systems/image/topology.png -------------------------------------------------------------------------------- /3-Quantum_Hardware_Systems/image/train.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/Reference-Guide-For-Quantum-Computing-A-Microsoft-Garage-Project/c1533b9472cbfe09b0e15a964d0c6fd73a8831fe/3-Quantum_Hardware_Systems/image/train.png -------------------------------------------------------------------------------- /3-Quantum_Hardware_Systems/image/transistor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/Reference-Guide-For-Quantum-Computing-A-Microsoft-Garage-Project/c1533b9472cbfe09b0e15a964d0c6fd73a8831fe/3-Quantum_Hardware_Systems/image/transistor.png -------------------------------------------------------------------------------- /3-Quantum_Hardware_Systems/image/two_quantum_dots.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/Reference-Guide-For-Quantum-Computing-A-Microsoft-Garage-Project/c1533b9472cbfe09b0e15a964d0c6fd73a8831fe/3-Quantum_Hardware_Systems/image/two_quantum_dots.png -------------------------------------------------------------------------------- /3-Quantum_Hardware_Systems/image/two_superconductors.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/Reference-Guide-For-Quantum-Computing-A-Microsoft-Garage-Project/c1533b9472cbfe09b0e15a964d0c6fd73a8831fe/3-Quantum_Hardware_Systems/image/two_superconductors.png -------------------------------------------------------------------------------- /3-Quantum_Hardware_Systems/image/vacancy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/Reference-Guide-For-Quantum-Computing-A-Microsoft-Garage-Project/c1533b9472cbfe09b0e15a964d0c6fd73a8831fe/3-Quantum_Hardware_Systems/image/vacancy.png -------------------------------------------------------------------------------- /4-Looking_Ahead/Conclusion.md: -------------------------------------------------------------------------------- 1 | ## Conclusion 2 | 3 | In fact, there are numerous disciplines involved in Quantum Computing, with great scope for exploration, 4 | business opportunities and study. In this context, we have seen that classical cryptography must evolve 5 | into a new post-quantum scenario, able to cope with new processing power that will be made available 6 | to individuals and companies as soon as the first quantum computers become more commercial. 7 | The journey that began in the 1990s with the discovery of Shor's algorithm is not only beginning, 8 | it is accelerating! 9 | -------------------------------------------------------------------------------- /4-Looking_Ahead/image/Azure_security.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/Reference-Guide-For-Quantum-Computing-A-Microsoft-Garage-Project/c1533b9472cbfe09b0e15a964d0c6fd73a8831fe/4-Looking_Ahead/image/Azure_security.png -------------------------------------------------------------------------------- /4-Looking_Ahead/image/BB84.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/Reference-Guide-For-Quantum-Computing-A-Microsoft-Garage-Project/c1533b9472cbfe09b0e15a964d0c6fd73a8831fe/4-Looking_Ahead/image/BB84.png -------------------------------------------------------------------------------- /4-Looking_Ahead/image/Grover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/Reference-Guide-For-Quantum-Computing-A-Microsoft-Garage-Project/c1533b9472cbfe09b0e15a964d0c6fd73a8831fe/4-Looking_Ahead/image/Grover.png -------------------------------------------------------------------------------- /4-Looking_Ahead/image/Mosca.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/Reference-Guide-For-Quantum-Computing-A-Microsoft-Garage-Project/c1533b9472cbfe09b0e15a964d0c6fd73a8831fe/4-Looking_Ahead/image/Mosca.png -------------------------------------------------------------------------------- /4-Looking_Ahead/image/NIST.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/Reference-Guide-For-Quantum-Computing-A-Microsoft-Garage-Project/c1533b9472cbfe09b0e15a964d0c6fd73a8831fe/4-Looking_Ahead/image/NIST.png -------------------------------------------------------------------------------- /4-Looking_Ahead/image/NIST_crypto.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/Reference-Guide-For-Quantum-Computing-A-Microsoft-Garage-Project/c1533b9472cbfe09b0e15a964d0c6fd73a8831fe/4-Looking_Ahead/image/NIST_crypto.png -------------------------------------------------------------------------------- /4-Looking_Ahead/image/Shor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/Reference-Guide-For-Quantum-Computing-A-Microsoft-Garage-Project/c1533b9472cbfe09b0e15a964d0c6fd73a8831fe/4-Looking_Ahead/image/Shor.png -------------------------------------------------------------------------------- /4-Looking_Ahead/image/cryptokey.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/Reference-Guide-For-Quantum-Computing-A-Microsoft-Garage-Project/c1533b9472cbfe09b0e15a964d0c6fd73a8831fe/4-Looking_Ahead/image/cryptokey.png -------------------------------------------------------------------------------- /4-Looking_Ahead/image/faster_than_light.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/Reference-Guide-For-Quantum-Computing-A-Microsoft-Garage-Project/c1533b9472cbfe09b0e15a964d0c6fd73a8831fe/4-Looking_Ahead/image/faster_than_light.png -------------------------------------------------------------------------------- /4-Looking_Ahead/image/standarization.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/Reference-Guide-For-Quantum-Computing-A-Microsoft-Garage-Project/c1533b9472cbfe09b0e15a964d0c6fd73a8831fe/4-Looking_Ahead/image/standarization.png -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing 2 | 3 | This project welcomes contributions and suggestions. Most contributions require you to 4 | agree to a Contributor License Agreement (CLA) declaring that you have the right to, 5 | and actually do, grant us the rights to use your contribution. For details, visit 6 | https://cla.microsoft.com. 7 | 8 | When you submit a pull request, a CLA-bot will automatically determine whether you need 9 | to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the 10 | instructions provided by the bot. You will only need to do this once across all repositories using our CLA. 11 | 12 | This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). 13 | For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) 14 | or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments. 15 | 16 | Contributions come in many forms: submitting issues, writing code, participating in discussions and community calls. 17 | 18 | This document provides the guidelines for how to contribute to the Quantum Community Book project. 19 | 20 | ## Issues 21 | 22 | This section describes the guidelines for submitting issues 23 | 24 | ### Issue Types 25 | 26 | There are 4 types of issues: 27 | 28 | - Issue/Bug: You've found content that seems to be incorrect, and want to report it, or create an issue to track it. 29 | - Issue/Discussion: You have something on your mind, which requires input form others in a discussion, before it eventually manifests as a proposal. 30 | - Issue/Proposal: Used for items that propose a new idea or subject. This allows feedback from others before content is written. 31 | - Issue/Question: Use this issue type, if you need help or have a question. 32 | 33 | ### Before You File 34 | 35 | Before you file an issue, make sure you've checked the following: 36 | 37 | 1. Check for existing issues 38 | - Before you create a new issue, please do a search in [open issues](https://github.com/KittyYeungQ/community_book/issues) to see if the issue or subject request has already been filed. 39 | - If you find your issue already exists, make relevant comments and add your [reaction](https://github.com/blog/2119-add-reaction-to-pull-requests-issues-and-comments). Use a reaction: 40 | - 👍 up-vote 41 | - 👎 down-vote 42 | 43 | ## Contributing to the Quantum Community Book 44 | 45 | This section describes the guidelines for contributing content to the Quantum Community Book. 46 | 47 | ### Pull Requests 48 | 49 | All contributions come through pull requests. To submit a proposed change, we recommend this workflow: 50 | 51 | 1. Make sure there's an issue (bug or proposal) raised, which sets the expectations for the contribution you are about to make. 52 | 2. Fork the relevant repo and create a new branch 53 | 3. Create your change 54 | 4. Update relevant documentation for the change 55 | 5. Commit and open a PR 56 | 6. Wait for the CI process to finish and make sure all checks are green 57 | 7. A maintainer of the project will be assigned, and you can expect a review 58 | 59 | #### Use work-in-progress PRs for early feedback 60 | 61 | A good way to communicate before investing too much time is to create a "Work-in-progress" PR and share it with your reviewers. The standard way of doing this is to add a "[WIP]" prefix in your PR's title and assign the **do-not-merge** label. This will let people looking at your PR know that it is not well baked yet. 62 | 63 | ## Code of Conduct 64 | 65 | This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). -------------------------------------------------------------------------------- /HOWTO.md: -------------------------------------------------------------------------------- 1 | # How to read this book 2 | 3 | 4 | **Installing Jupyter Notebook to optimize working with this repo** 5 | 6 | While using _Reference Guide for Quantum Computing, a Microsoft Garage project_ you might notice some discrepancies in rendering equations in different IDEs and on GitHub. For a smooth experience, use Jupyter Notebooks [online](https://nbviewer.jupyter.org/github/microsoft/Reference-Guide-For-Quantum-Computing-A-Microsoft-Garage-Project) or locally, following the below instructions: 7 | 8 | ## Requirements: 9 | 10 | Operating system: Windows 10, Linux, MacOS 11 | 12 | Runtime: Python 3.3+ 13 | 14 | 15 | ## Installing Jupyter with pip 16 | 17 | Before you install jupyter with pip, make sure you are on the newest version of [pip](https://pip.pypa.io/en/stable/installing/). 18 | 19 | ```pip3 install --upgrade pip``` 20 | 21 | To install the Jupyter Notebook use the following command 22 | 23 | ```pip3 install jupyter``` 24 | 25 | For an always current installation guide of Jupyter Notebook follow the official instructions. (https://jupyter.readthedocs.io/en/latest/install.html) 26 | 27 | Now clone the community_book GitHub repository. 28 | 29 | ```git clone git@github.com:KittyYeungQ/community_book.git``` 30 | 31 | From the command line navigate to the cloned community_book folder via 32 | 33 | ```cd ~/path/to/community_book/``` 34 | 35 | To run the notebook use 36 | 37 | ```jupyter notebook``` 38 | **Kitty**: this did not work for me, had to use ```python -m notebook``` 39 | 40 | Jupyter Notebook should run at localhost:8888. Usually the browser opens this url automatically. 41 | 42 | ![alt text](media/jupyter_1.png) 43 | 44 | Now you can open every chapter by navigating through the folder structures. 45 | 46 | ![alt text](media/jupyter_2.png) -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) Microsoft Corporation. 2 | 3 | MIT License 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. -------------------------------------------------------------------------------- /QuantumComputingViaQSharpSolution/01_HelloQuantumWorld/01_HelloQuantumWorld.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | netcoreapp3.1 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /QuantumComputingViaQSharpSolution/01_HelloQuantumWorld/Program.qs: -------------------------------------------------------------------------------- 1 | namespace Quantum._01_HelloQuantumWorld { 2 | 3 | open Microsoft.Quantum.Canon; 4 | open Microsoft.Quantum.Intrinsic; 5 | 6 | 7 | @EntryPoint() 8 | operation HelloQuantumWorld () : Unit { 9 | Message("Hello Quantum world!"); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /QuantumComputingViaQSharpSolution/02_Demo using-M-Message-let-Zero-One/02_Demo using-M-Message-let-Zero-One.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | netcoreapp3.1 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /QuantumComputingViaQSharpSolution/02_Demo using-M-Message-let-Zero-One/Program.qs: -------------------------------------------------------------------------------- 1 | namespace Quantum._02_Demo_using_M_Message_let_Zero_One { 2 | 3 | open Microsoft.Quantum.Canon; 4 | open Microsoft.Quantum.Intrinsic; 5 | 6 | 7 | @EntryPoint() 8 | operation HelloQ () : Unit { 9 | use qubit = Qubit(); 10 | // M is used to measure a qubit. 11 | // it returns output of type Result. It can be either Zero or One. 12 | // let will create an immutable variable. Once assigned it can't be changed. 13 | // immutables will give better performance as compiler may optimize our code. 14 | let result = M(qubit); 15 | // Since we performed no operation, the Result will always be Zero. 16 | if(IsResultZero(result)) 17 | { 18 | //Message will print a string. 19 | Message("Zero"); 20 | } 21 | elif(IsResultOne(result)) 22 | { 23 | Message("One"); 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /QuantumComputingViaQSharpSolution/03_Demo X-Reset/03_Demo X-Reset.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | netcoreapp3.1 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /QuantumComputingViaQSharpSolution/03_Demo X-Reset/Program.qs: -------------------------------------------------------------------------------- 1 | namespace Quantum._03_Demo_X_Reset { 2 | 3 | open Microsoft.Quantum.Canon; 4 | open Microsoft.Quantum.Intrinsic; 5 | 6 | 7 | @EntryPoint() 8 | operation Demo_X_Reset () : Unit { 9 | 10 | use qubit = Qubit(); 11 | 12 | //Applying X will reverse the value. 13 | X(qubit); 14 | 15 | // Measure the value of Qubit 16 | let r = M(qubit); 17 | 18 | if(r == Zero) 19 | { 20 | Message("Zero"); 21 | } 22 | elif(r == One) 23 | { 24 | //Output will be one. 25 | Message("One"); 26 | } 27 | 28 | // At the end of using, we need to Reset all the qubits to Zero 29 | Reset(qubit); 30 | 31 | 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /QuantumComputingViaQSharpSolution/04_Demo_ResultAsBool_BoolAsString/04_Demo_ResultAsBool_BoolAsString.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | netcoreapp3.1 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /QuantumComputingViaQSharpSolution/04_Demo_ResultAsBool_BoolAsString/Program.qs: -------------------------------------------------------------------------------- 1 | namespace Quantum._04_Demo_ResultAsBool_BoolAsString { 2 | 3 | open Microsoft.Quantum.Canon; 4 | open Microsoft.Quantum.Intrinsic; 5 | open Microsoft.Quantum.Convert as Convert; 6 | 7 | @EntryPoint() 8 | operation Demo_ResultAsBool_BoolAsString () : Unit { 9 | use qubit = Qubit(); 10 | X(qubit); 11 | let result = M(qubit); 12 | // Message will only take strings. 13 | // First convert the Result to Bool 14 | // Then convert the bool to String 15 | Message(Convert.BoolAsString(Convert.ResultAsBool(result))); 16 | Reset(qubit); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /QuantumComputingViaQSharpSolution/05_Demo MultiM-ResetAll/05_Demo MultiM-ResetAll.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | netcoreapp3.1 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /QuantumComputingViaQSharpSolution/05_Demo MultiM-ResetAll/Program.qs: -------------------------------------------------------------------------------- 1 | namespace Quantum._05_Demo_MultiM_ResetAll { 2 | 3 | open Microsoft.Quantum.Canon; 4 | open Microsoft.Quantum.Intrinsic; 5 | open Microsoft.Quantum.Measurement; 6 | open Microsoft.Quantum.Convert; 7 | 8 | @EntryPoint() 9 | operation HelloQ () : Unit { 10 | 11 | use qubits = Qubit[2]; 12 | // Reversing the second qubit. 13 | X(qubits[1]); 14 | //MultiM will measure all the qubits in the array 15 | //and retuns an array of Result datatype. 16 | let results = MultiM(qubits); 17 | 18 | Message(BoolAsString(ResultAsBool(results[0]))); 19 | Message(BoolAsString(ResultAsBool(results[1]))); 20 | 21 | //ResetAll will reset all the qubits in the array. 22 | ResetAll(qubits); 23 | 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /QuantumComputingViaQSharpSolution/06_Demo H/06_Demo H.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | netcoreapp3.1 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /QuantumComputingViaQSharpSolution/06_Demo H/Program.qs: -------------------------------------------------------------------------------- 1 | namespace _06_Demo_H { 2 | 3 | open Microsoft.Quantum.Canon; 4 | open Microsoft.Quantum.Intrinsic; 5 | open Microsoft.Quantum.Convert as Convert; 6 | 7 | @EntryPoint() 8 | operation HelloQ() : Unit { 9 | use qubit = Qubit(); 10 | 11 | // Applying Hadamard on the qubit. 12 | H(qubit); 13 | let result = M(qubit); 14 | // This output might change for every execution 15 | // because H will put the qubit in a 50/50 superposition of 0 and 1. 16 | Message(Convert.BoolAsString(Convert.ResultAsBool(result))); 17 | Reset(qubit); 18 | 19 | } 20 | } 21 | 22 | -------------------------------------------------------------------------------- /QuantumComputingViaQSharpSolution/07_Demo H count-mutable-set-for-IntAsString/07_Demo H count-mutable-set-for-IntAsString.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | netcoreapp3.1 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /QuantumComputingViaQSharpSolution/07_Demo H count-mutable-set-for-IntAsString/Program.qs: -------------------------------------------------------------------------------- 1 | namespace Quantum._07_Demo_H_count_mutable_set_for_IntAsString { 2 | 3 | open Microsoft.Quantum.Canon; 4 | open Microsoft.Quantum.Intrinsic; 5 | open Microsoft.Quantum.Convert; 6 | 7 | 8 | @EntryPoint() 9 | operation Demo_H_count_mutable_set_for_IntAsString () : Unit { 10 | 11 | // Unlike let, variables declared as mutable can be modified later. 12 | // Data type is infered during initialization. Her it is Int. 13 | mutable countZeroes = 0; 14 | mutable countOnes = 0; 15 | 16 | //Running the for loop for 1000 times 17 | for iter in 1..1000 18 | { 19 | use qubits = Qubit[1] 20 | { 21 | // Applying Hadamard on the qubit 22 | H(qubits[0]); 23 | 24 | //Perform Measurement 25 | let result = M(qubits[0]); 26 | 27 | if(result == Zero) 28 | { 29 | set countZeroes = countZeroes + 1; 30 | } 31 | if(result == One) 32 | { 33 | set countOnes = countOnes + 1; 34 | } 35 | 36 | //Resetting the qubit to Zero at the end of every iteration. 37 | ResetAll(qubits); 38 | } 39 | } 40 | 41 | //ToStringI will convert an integer to string 42 | // Since we have executed the loop for 1000 times. 43 | // Each count should be approximately equal to 500. 44 | // But it might vary on each execution. 45 | Message("countZeroes: " + IntAsString(countZeroes)); 46 | Message("countOnes: " + IntAsString(countOnes)); 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /QuantumComputingViaQSharpSolution/08_Demo Parameters/08_Demo Parameters.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | netcoreapp3.1 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /QuantumComputingViaQSharpSolution/08_Demo Parameters/Program.qs: -------------------------------------------------------------------------------- 1 | namespace Quantum._08_Demo_Parameters { 2 | 3 | open Microsoft.Quantum.Canon; 4 | open Microsoft.Quantum.Intrinsic; 5 | open Microsoft.Quantum.Convert; 6 | 7 | @EntryPoint() 8 | operation HelloQ () : Unit { 9 | let iterations = 1000; 10 | let message = "Starting to measure the output of H gate by running it " + IntAsString(iterations) + " number of times."; 11 | let (zeroCount, oneCount) = CountZeroesAndOnes(iterations, message); 12 | Message($"Number of Zeroes: {zeroCount}"); 13 | Message($"Number of Onoes: {oneCount}"); 14 | } 15 | 16 | // Changed the signature to take a tuple with two values and 17 | // return a tuple with two values. 18 | // Number of values in the tuple can be anything. 19 | operation CountZeroesAndOnes(iterations: Int, message: String) : (Int,Int){ 20 | Message(message); 21 | mutable countZeroes = 0; 22 | mutable countOnes = 0; 23 | // Using the parameter from the EntryPoint operation. 24 | for iter in 1..iterations 25 | { 26 | use qubit = Qubit(); 27 | // Applying Hadamard on the qubit 28 | H(qubit); 29 | let result = M(qubit); 30 | if(IsResultZero(result)) 31 | { 32 | set countZeroes = countZeroes + 1; 33 | } 34 | if(IsResultOne(result)) 35 | { 36 | set countOnes = countOnes + 1; 37 | } 38 | 39 | // Resetting the qubit to Zero at the end of every iteration. 40 | Reset(qubit); 41 | } 42 | 43 | // Returning the count of zeroes and ones as a tuple with two values. 44 | // You can return a tuple with one value also. 45 | return (countZeroes, countOnes); 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /QuantumComputingViaQSharpSolution/09_Demo randomNumberGenerator/09_Demo randomNumberGenerator.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | netcoreapp3.1 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /QuantumComputingViaQSharpSolution/09_Demo randomNumberGenerator/09_Demo randomNumberGenerator.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 16 4 | VisualStudioVersion = 16.0.30204.135 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "09_Demo randomNumberGenerator", "09_Demo randomNumberGenerator.csproj", "{74E4B38B-51A6-4099-B732-E2DA77332BFA}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Any CPU = Debug|Any CPU 11 | Release|Any CPU = Release|Any CPU 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {74E4B38B-51A6-4099-B732-E2DA77332BFA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {74E4B38B-51A6-4099-B732-E2DA77332BFA}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {74E4B38B-51A6-4099-B732-E2DA77332BFA}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {74E4B38B-51A6-4099-B732-E2DA77332BFA}.Release|Any CPU.Build.0 = Release|Any CPU 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | GlobalSection(ExtensibilityGlobals) = postSolution 23 | SolutionGuid = {731E619B-EE00-4B2C-8DD0-903F3BE18D49} 24 | EndGlobalSection 25 | EndGlobal 26 | -------------------------------------------------------------------------------- /QuantumComputingViaQSharpSolution/09_Demo randomNumberGenerator/Program.qs: -------------------------------------------------------------------------------- 1 | namespace Quantum._09_Demo_randomNumberGenerator { 2 | 3 | open Microsoft.Quantum.Convert; 4 | open Microsoft.Quantum.Math; 5 | open Microsoft.Quantum.Measurement; 6 | open Microsoft.Quantum.Canon; 7 | open Microsoft.Quantum.Intrinsic; 8 | 9 | operation RandomNumberGenerator() : Result { 10 | use qubit = Qubit(); 11 | 12 | return MResetX(qubit); 13 | 14 | } 15 | 16 | operation RandomNumberInRange(max : Int) : Int { 17 | mutable bits = new Result[0]; 18 | 19 | for idxBit in 1..BitSizeI(max) { 20 | 21 | set bits += [RandomNumberGenerator()]; 22 | 23 | } 24 | 25 | // Coverting Bit Array to give an Int 26 | let sample = ResultArrayAsInt(bits); 27 | 28 | // In case the random number generated is greater than max value, max value is returned. 29 | return sample > max ? RandomNumberInRange(max) | sample; 30 | } 31 | 32 | @EntryPoint() 33 | operation RandomNumber() : Int { 34 | 35 | // pre-setting the max value as 100 36 | let max = 100; 37 | 38 | Message($"Sampling a random number between 0 and {max}: "); 39 | 40 | return RandomNumberInRange(max); 41 | 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /QuantumComputingViaQSharpSolution/10_Demo_Array_Functions/10_Demo_Array_Functions.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | netcoreapp3.1 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /QuantumComputingViaQSharpSolution/10_Demo_Array_Functions/Program.qs: -------------------------------------------------------------------------------- 1 | namespace Quantum._10_Demo_Array_Functions { 2 | 3 | open Microsoft.Quantum.Canon; 4 | // Import this library to use Range Functions. 5 | open Microsoft.Quantum.Core; 6 | open Microsoft.Quantum.Intrinsic; 7 | // Import this library to work with Arrays. 8 | open Microsoft.Quantum.Arrays; 9 | open Microsoft.Quantum.Convert as Convert; 10 | 11 | 12 | @EntryPoint() 13 | operation Demo_Array_Functions () : Unit { 14 | // Arrays start from 0th index. 15 | mutable arr = [10, 11, 36, 49]; 16 | for i in IndexRange(arr) 17 | { 18 | Message(Convert.IntAsString(arr[i])); 19 | } 20 | 21 | // Appending two arrays. 22 | set arr = arr + [40, 50]; 23 | for i in IndexRange(arr) 24 | { 25 | Message(Convert.IntAsString(arr[i])); 26 | } 27 | 28 | // Head returns the first element of the array. 29 | Message("Head of the array: " + Convert.IntAsString(Head(arr))); 30 | 31 | // Tail returns the last element of the array. 32 | Message("Tail of the array: " + Convert.IntAsString(Tail(arr))); 33 | 34 | // Rest returns a new array by skipping the first element 35 | Message("Rest Demo:"); 36 | mutable restArr = Rest(arr); 37 | Message("Head of the Rest array: " + Convert.IntAsString(Head(restArr))); 38 | for i in IndexRange(restArr) 39 | { 40 | Message(Convert.IntAsString(restArr[i])); 41 | } 42 | 43 | // Subarray picks only the items mentioned as indexes in the first array. 44 | Message("Subarray Demo:"); 45 | mutable newSubArr = Subarray([2, 3, 0], arr); 46 | for i in IndexRange(newSubArr) 47 | { 48 | Message(Convert.IntAsString(newSubArr[i])); 49 | } 50 | 51 | // Reverse Array Demo. 52 | Message("Reverse Array Demo:"); 53 | mutable reverseArr = Reversed(arr); 54 | for i in IndexRange(reverseArr) 55 | { 56 | Message(Convert.IntAsString(reverseArr[i])); 57 | } 58 | 59 | // Range Demo 60 | // The three integers indicate start..step..stop. The default value of step is 1. 61 | Message("Range Demo: Positive Step"); 62 | for i in 0..2..10 63 | { 64 | Message(Convert.IntAsString(i)); 65 | } 66 | 67 | // Negative step 68 | Message("Range Demo: Negative Step"); 69 | for i in 10..-2..0 70 | { 71 | Message(Convert.IntAsString(i)); 72 | } 73 | 74 | // Range Functions are present in Microsoft.Quantum.Core library and they can be used as variables. 75 | Message("Range functions demo"); 76 | let range = 1..5..100; 77 | Message(Convert.IntAsString(RangeStart(range))); 78 | Message(Convert.IntAsString(RangeStep(range))); 79 | Message(Convert.IntAsString(RangeEnd(range))); 80 | } 81 | } 82 | -------------------------------------------------------------------------------- /QuantumComputingViaQSharpSolution/11_Demo ResultArrayAsInt/11_Demo ResultArrayAsInt.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | netcoreapp3.1 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /QuantumComputingViaQSharpSolution/11_Demo ResultArrayAsInt/Program.qs: -------------------------------------------------------------------------------- 1 | namespace Quantum._11_Demo_ResultArrayAsInt { 2 | 3 | open Microsoft.Quantum.Canon; 4 | open Microsoft.Quantum.Intrinsic; 5 | open Microsoft.Quantum.Convert; 6 | 7 | @EntryPoint() 8 | operation HelloQ () : Unit { 9 | //ResultAsInt will take an array of results and returns an integer. 10 | //The input array is considered to be LittleEndian 11 | mutable value = ResultArrayAsInt([Zero,Zero]); 12 | Message($"[Zero;Zero]: {value}"); 13 | 14 | //This will give 2 because the input is considered LittleEndian 15 | set value = ResultArrayAsInt([Zero,One]); 16 | Message($"[Zero;One]: {value}"); 17 | 18 | //This will give 1 because the input is considered LittleEndian 19 | set value = ResultArrayAsInt([One,Zero]); 20 | Message($"[One;Zero]: {value}"); 21 | 22 | //This will give 3 because the input is considered LittleEndian 23 | set value = ResultArrayAsInt([One,One]); 24 | Message($"[One;One]: {value}"); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /QuantumComputingViaQSharpSolution/12_Demo CNOT/12_Demo CNOT.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | netcoreapp3.1 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /QuantumComputingViaQSharpSolution/12_Demo CNOT/Program.qs: -------------------------------------------------------------------------------- 1 | namespace _12_Demo_CNOT { 2 | 3 | open Microsoft.Quantum.Canon; 4 | open Microsoft.Quantum.Intrinsic; 5 | open Microsoft.Quantum.Measurement; 6 | open Microsoft.Quantum.Arrays; 7 | open Microsoft.Quantum.Convert as Convert; 8 | 9 | 10 | @EntryPoint() 11 | operation HelloQ() : Unit { 12 | Message("Copmuting CNOT for a two qubit system for all possible combinations!"); 13 | use qubits = Qubit[2]; 14 | 15 | Message("Input: 0-0"); 16 | CNOT(qubits[0], qubits[1]); 17 | mutable results = MultiM(qubits); 18 | Message("Output: " + Convert.IntAsString(Convert.ResultArrayAsInt(Subarray([0], results))) + "-" + 19 | Convert.IntAsString(Convert.ResultArrayAsInt(Subarray([1], results)))); 20 | ResetAll(qubits); 21 | 22 | Message("Input: 0-1"); 23 | X(qubits[1]); 24 | CNOT(qubits[0], qubits[1]); 25 | set results = MultiM(qubits); 26 | Message("Output: " + Convert.IntAsString(Convert.ResultArrayAsInt(Subarray([0], results))) + "-" + 27 | Convert.IntAsString(Convert.ResultArrayAsInt(Subarray([1], results)))); 28 | ResetAll(qubits); 29 | 30 | Message("Input: 1-0"); 31 | X(qubits[0]); 32 | CNOT(qubits[0], qubits[1]); 33 | set results = MultiM(qubits); 34 | Message("Output: " + Convert.IntAsString(Convert.ResultArrayAsInt(Subarray([0], results))) + "-" + 35 | Convert.IntAsString(Convert.ResultArrayAsInt(Subarray([1], results)))); 36 | ResetAll(qubits); 37 | 38 | Message("Input: 1-1"); 39 | X(qubits[0]); 40 | X(qubits[1]); 41 | CNOT(qubits[0], qubits[1]); 42 | set results = MultiM(qubits); 43 | Message("Output: " + Convert.IntAsString(Convert.ResultArrayAsInt(Subarray([0], results))) + "-" + 44 | Convert.IntAsString(Convert.ResultArrayAsInt(Subarray([1], results)))); 45 | ResetAll(qubits); 46 | 47 | } 48 | } 49 | 50 | -------------------------------------------------------------------------------- /QuantumComputingViaQSharpSolution/13_Demo CCNOT/13_Demo CCNOT.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | netcoreapp3.1 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /QuantumComputingViaQSharpSolution/13_Demo CCNOT/Program.qs: -------------------------------------------------------------------------------- 1 | namespace Quantum._13_Demo_CCNOT { 2 | 3 | open Microsoft.Quantum.Canon; 4 | open Microsoft.Quantum.Intrinsic; 5 | open Microsoft.Quantum.Convert; 6 | open Microsoft.Quantum.Measurement; 7 | open Microsoft.Quantum.Arrays; 8 | 9 | 10 | @EntryPoint() 11 | operation Demo_CCNOT () : Unit { 12 | use qubits = Qubit[3] 13 | { 14 | 15 | //CCNOT gate ensures that when first two controlling bit are set, 16 | //Controlled bit gets flipped 17 | Message("Input: 0-0-0"); 18 | CCNOT(qubits[0], qubits[1], qubits[2]); 19 | mutable results = MultiM(qubits); 20 | Message("Output: " + IntAsString(ResultArrayAsInt(Subarray([0],results))) + "-" + 21 | IntAsString(ResultArrayAsInt(Subarray([1],results))) + "-" + 22 | IntAsString(ResultArrayAsInt(Subarray([2],results)))); 23 | 24 | ResetAll(qubits); 25 | 26 | Message("Input: 0-0-1"); 27 | X(qubits[2]); 28 | CCNOT(qubits[0], qubits[1], qubits[2]); 29 | set results = MultiM(qubits); 30 | Message("Output: " + IntAsString(ResultArrayAsInt(Subarray([0],results))) + "-" + 31 | IntAsString(ResultArrayAsInt(Subarray([1],results))) + "-" + 32 | IntAsString(ResultArrayAsInt(Subarray([2],results)))); 33 | ResetAll(qubits); 34 | 35 | Message("Input: 1-0-0"); 36 | X(qubits[0]); 37 | CCNOT(qubits[0], qubits[1], qubits[2]); 38 | set results = MultiM(qubits); 39 | Message("Output: " + IntAsString(ResultArrayAsInt(Subarray([0],results))) + "-" + 40 | IntAsString(ResultArrayAsInt(Subarray([1],results))) + "-" + 41 | IntAsString(ResultArrayAsInt(Subarray([2],results)))); 42 | ResetAll(qubits); 43 | 44 | Message("Input: 1-1-0"); 45 | X(qubits[0]); 46 | X(qubits[1]); 47 | CCNOT(qubits[0], qubits[1], qubits[2]); 48 | set results = MultiM(qubits); 49 | Message("Output: " + IntAsString(ResultArrayAsInt(Subarray([0],results))) + "-" + 50 | IntAsString(ResultArrayAsInt(Subarray([1],results))) + "-" + 51 | IntAsString(ResultArrayAsInt(Subarray([2],results)))); 52 | ResetAll(qubits); 53 | 54 | } 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /QuantumComputingViaQSharpSolution/14_Demo ApplyToEach-Controlled X-ControlledOnBitString/14_Demo ApplyToEach-Controlled X-ControlledOnBitString.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | netcoreapp3.1 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /QuantumComputingViaQSharpSolution/14_Demo ApplyToEach-Controlled X-ControlledOnBitString/Program.qs: -------------------------------------------------------------------------------- 1 | namespace Quantum._14_Demo_ApplyToEach_Controlled_X_ControlledOnBitString { 2 | 3 | open Microsoft.Quantum.Canon; 4 | open Microsoft.Quantum.Intrinsic; 5 | open Microsoft.Quantum.Measurement; 6 | open Microsoft.Quantum.Arrays; 7 | open Microsoft.Quantum.Convert; 8 | 9 | @EntryPoint() 10 | operation HelloQ () : Unit { 11 | 12 | use qubits = Qubit[3]; 13 | mutable str = ""; 14 | // X is applied to all the qubits. 15 | ApplyToEach(X, qubits); 16 | let results = MultiM(qubits); 17 | for i in IndexRange(qubits) 18 | { 19 | set str = str + IntAsString(ResultArrayAsInt([results[i]])); 20 | } 21 | 22 | // Output will be 111. 23 | Message($"ApplyToEach Demo: {str}"); 24 | ResetAll(qubits); 25 | 26 | // Controlled X Demo 27 | // First parameter should be an array of qubits and the second parameter a single Qubit 28 | // X will be applied on the qubit in teh second parameter only if all the qubits in the array are ones 29 | // This is a generic form of CNOT 30 | set str = ""; 31 | use inputQubits = Qubit[3]; 32 | ApplyToEach(X, inputQubits); 33 | for i in IndexRange(inputQubits) 34 | { 35 | use outputQubit = Qubit(); 36 | // Any gate can be used in the place of X.. 37 | (Controlled X)(inputQubits, outputQubit); 38 | set str = str + IntAsString(ResultArrayAsInt([M(outputQubit)])); 39 | Reset(outputQubit); 40 | 41 | } 42 | 43 | ResetAll(inputQubits); 44 | Message($"Controlled X Demo: {str}"); 45 | 46 | // ControlledOnBitString: This is more generic than Controlled X. 47 | // We can control on any bit combination; In this example: 101 48 | X(inputQubits[0]); 49 | X(inputQubits[2]); 50 | use outputQubit = Qubit(); 51 | (ControlledOnBitString([true, false, true], X))(inputQubits, outputQubit); 52 | let result = IntAsString(ResultArrayAsInt([M(outputQubit)])); 53 | Message($"ControlledOnBitString Demo: {result}"); 54 | Reset(outputQubit); 55 | ResetAll(inputQubits); 56 | 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /QuantumComputingViaQSharpSolution/15_Demo XAsString-XAsStringWithFormat/15_Demo XAsString-XAsStringWithFormat.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | netcoreapp3.1 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /QuantumComputingViaQSharpSolution/15_Demo XAsString-XAsStringWithFormat/Program.qs: -------------------------------------------------------------------------------- 1 | namespace Quantum._15_Demo_XAsString_XAsStringWithFormat { 2 | 3 | open Microsoft.Quantum.Canon; 4 | open Microsoft.Quantum.Intrinsic; 5 | open Microsoft.Quantum.Convert; 6 | 7 | 8 | @EntryPoint() 9 | operation Demo_XAsString_XAsStringWithFormat () : Unit { 10 | 11 | use qubit = Qubit(); 12 | //Convert an integer to a String 13 | Message(IntAsString(2)); 14 | //Convert a double to a String 15 | Message(DoubleAsString(2.3)); 16 | //Convert a boolean to a String 17 | Message(BoolAsString(true)); 18 | //Formatted integer 19 | Message(IntAsStringWithFormat(22345,"C"));//Currency 20 | Message(IntAsStringWithFormat(22345,"D8"));//D8 21 | Message(IntAsStringWithFormat(31,"X8"));//X8 22 | Message(IntAsStringWithFormat(142,"0000#")); 23 | //Formatted double 24 | Message(DoubleAsStringWithFormat(22345.12,"C"));//Currency 25 | Message(DoubleAsStringWithFormat(142.12,"0000.000")); 26 | 27 | 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /QuantumComputingViaQSharpSolution/16_Demo bool-result-int-conversions/16_Demo bool-result-int-conversions.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | netcoreapp3.1 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /QuantumComputingViaQSharpSolution/16_Demo bool-result-int-conversions/Program.qs: -------------------------------------------------------------------------------- 1 | namespace Quantum._16_Demo_bool_result_int_conversions { 2 | 3 | open Microsoft.Quantum.Arrays; 4 | open Microsoft.Quantum.Canon; 5 | open Microsoft.Quantum.Intrinsic; 6 | open Microsoft.Quantum.Measurement; 7 | open Microsoft.Quantum.Convert as Convert; 8 | 9 | @EntryPoint() 10 | operation Demo_Bool_Result_Int_Conversions () : Unit { 11 | use qubits = Qubit[2] 12 | { 13 | 14 | let result = M(qubits[0]); 15 | 16 | // ResultAsBool demo. 17 | Message("ResultAsBool demo"); 18 | Message(Convert.BoolAsString(Convert.ResultAsBool(result))); 19 | 20 | let resultArr = MultiM(qubits); 21 | 22 | // ResultArrayAsBoolArray demo. 23 | Message("ResultArrayAsBoolArray demo"); 24 | let boolArr = Convert.ResultArrayAsBoolArray(resultArr); 25 | for i in IndexRange(boolArr) 26 | { 27 | Message(Convert.BoolAsString(boolArr[i])); 28 | } 29 | 30 | // BoolAsResult demo. 31 | Message("BoolAsResult demo"); 32 | mutable resultFromBool = Convert.BoolAsResult(true); 33 | if(resultFromBool == One) 34 | { 35 | Message("One"); 36 | } 37 | set resultFromBool = Convert.BoolAsResult(false); 38 | if(resultFromBool == Zero) 39 | { 40 | Message("Zero"); 41 | } 42 | 43 | // BoolArrayAsResultArray demo. 44 | Message("BoolArrayAsResultArray demo"); 45 | let boolArray = [true, false, true]; 46 | let resultArrFromBoolArr = Convert.BoolArrayAsResultArray(boolArray); 47 | if (IsResultOne(resultArrFromBoolArr[0])) 48 | { 49 | Message("First Result: One"); 50 | } 51 | 52 | if (IsResultZero(resultArrFromBoolArr[1])) 53 | { 54 | Message("Second Result: Zero"); 55 | } 56 | 57 | if (not IsResultZero(resultArrFromBoolArr[2])) 58 | { 59 | Message("Third Result: One"); 60 | } 61 | 62 | // IsResultZero demo. 63 | Message("IsResultZero demo"); 64 | if(IsResultZero(M(qubits[0])) == true){ 65 | Message("Zero"); 66 | } 67 | 68 | // IsResultOne demo. 69 | Message("IsResultOne demo"); 70 | if(IsResultOne(M(qubits[0])) != true){ 71 | Message("Zero"); 72 | } 73 | 74 | // ResultArrayAsInt demo. 75 | // 0th entry will be LSB. 76 | Message("ResultArrayAsInt demo"); 77 | X(qubits[1]); 78 | mutable resultAsInt = Convert.ResultArrayAsInt(MultiM(qubits)); 79 | // Output will be 2. 80 | Message(Convert.IntAsString(resultAsInt)); 81 | 82 | ResetAll(qubits); 83 | 84 | } 85 | } 86 | } 87 | -------------------------------------------------------------------------------- /QuantumComputingViaQSharpSolution/17_Demo Math Functions/17_Demo Math Functions.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | netcoreapp3.1 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /QuantumComputingViaQSharpSolution/17_Demo Math Functions/Program.qs: -------------------------------------------------------------------------------- 1 | namespace Quantum._17_Demo_Math_Functions { 2 | 3 | open Microsoft.Quantum.Canon; 4 | open Microsoft.Quantum.Intrinsic; 5 | open Microsoft.Quantum.Convert; 6 | open Microsoft.Quantum.Math; 7 | 8 | 9 | @EntryPoint() 10 | operation Demo_Math_Functions () : Unit { 11 | 12 | //AbsD 13 | Message("AbsD(-1.2): " + DoubleAsString(AbsD(-1.2))); 14 | //AbsI 15 | Message("AbsI(-12): " + IntAsString(AbsI(-12))); 16 | //Ceiling 17 | Message("Ceiling(12.2): " + IntAsString(Ceiling(12.2))); 18 | //Complex 19 | mutable complex = Complex(1.0,2.2); 20 | 21 | //PI() 22 | Message("PI(): " + DoubleAsString(PI())); 23 | 24 | //Sin 0 25 | Message("Sin(0): " + DoubleAsString(Sin(0.0))); 26 | //Sin(PI()/2.0) 27 | Message("Sin(PI()/2.0): " + DoubleAsString(Sin(PI()/2.0))); 28 | //Sin(PI()) 29 | Message("Sin(PI()): " + DoubleAsString(Sin(PI()))); 30 | //ArcSin(1.0) 31 | Message("ArcSin(1.0): " + DoubleAsString(ArcSin(1.0))); 32 | //ArcTan(0.5) 33 | Message("ArcTan(0.5): " + DoubleAsString(ArcTan(0.5))); 34 | //ArcTan2(1.0,0.0) 35 | Message("ArcTan2(1.0,0.0): " + DoubleAsString(ArcTan2(1.0,0.0))); 36 | 37 | //e 38 | Message("e: " + DoubleAsString(E())); 39 | //e^2 40 | Message("e^2: " + DoubleAsString(ExpD(2.0))); 41 | //Modulus 42 | Message("Modulus : " + IntAsString(ModulusI(8,5))); 43 | //PowD 44 | Message("PowD : " + DoubleAsString(PowD(2.0,3.0))); 45 | //Round 46 | Message("Round : " + IntAsString(Round(2.6))); 47 | //Truncate 48 | Message("Truncate : " + IntAsString(Truncate(2.6))); 49 | //Sqrt 50 | Message("Sqrt : " + DoubleAsString(Sqrt(8.0))); 51 | //Log-base e 52 | Message("Log : " + DoubleAsString(Log(E()))); 53 | //Log10-base 10 54 | Message("Log10 : " + DoubleAsString(Log10(100.0))); 55 | //Lg-base 2 56 | Message("Lg : " + DoubleAsString(Lg(4.0))); 57 | 58 | Message("Done"); 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /QuantumComputingViaQSharpSolution/18_Demo Rotations/18_Demo Rotations.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | netcoreapp3.1 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /QuantumComputingViaQSharpSolution/18_Demo Rotations/Program.qs: -------------------------------------------------------------------------------- 1 | namespace _18_Demo_Rotations { 2 | open Microsoft.Quantum.Arrays; 3 | open Microsoft.Quantum.Canon; 4 | open Microsoft.Quantum.Intrinsic; 5 | // Import this library to get Math operations like PI, Sqrt etc. 6 | open Microsoft.Quantum.Math; 7 | open Microsoft.Quantum.Convert as Convert; 8 | 9 | 10 | @EntryPoint() 11 | operation HelloQ() : Unit { 12 | mutable countZero = 0; 13 | mutable countOne = 0; 14 | mutable iterations = 1000; 15 | 16 | use qubit = Qubit(); 17 | // Measure without any operation 18 | for i in 1..iterations 19 | { 20 | let result = M(qubit); 21 | if(IsResultZero(result)) 22 | { 23 | set countZero = countZero + 1; 24 | } 25 | else 26 | { 27 | set countOne = countOne + 1; 28 | } 29 | Reset(qubit); 30 | } 31 | Message("Measure without any operation:"); 32 | Message("CountZero: " + Convert.IntAsString(countZero)); 33 | Message("CountOne: " + Convert.IntAsString(countOne)); 34 | 35 | 36 | // Rx(PI(), qubit); 37 | // Will make Zero to One 38 | set countZero = 0; 39 | set countOne = 0; 40 | for i in 1..iterations 41 | { 42 | Rx(PI(), qubit); 43 | let result = M(qubit); 44 | if(IsResultZero(result)) 45 | { 46 | set countZero = countZero + 1; 47 | } 48 | else 49 | { 50 | set countOne = countOne + 1; 51 | } 52 | Reset(qubit); 53 | } 54 | Message("Rx(PI(), qubit):"); 55 | Message("CountZero: " + Convert.IntAsString(countZero)); 56 | Message("CountOne: " + Convert.IntAsString(countOne)); 57 | 58 | // Ry(PI(), qubit); 59 | // Will also make Zero to One 60 | set countZero = 0; 61 | set countOne = 0; 62 | for i in 1..iterations 63 | { 64 | Ry(PI(), qubit); 65 | let result = M(qubit); 66 | if(IsResultZero(result)) 67 | { 68 | set countZero = countZero + 1; 69 | } 70 | else 71 | { 72 | set countOne = countOne + 1; 73 | } 74 | Reset(qubit); 75 | } 76 | Message("Ry(PI(), qubit):"); 77 | Message("CountZero: " + Convert.IntAsString(countZero)); 78 | Message("CountOne: " + Convert.IntAsString(countOne)); 79 | 80 | // Rz(PI(), qubit); 81 | // Zero will remain as Zero 82 | set countZero = 0; 83 | set countOne = 0; 84 | for i in 1..iterations 85 | { 86 | Rz(PI(), qubit); 87 | let result = M(qubit); 88 | if(IsResultZero(result)) 89 | { 90 | set countZero = countZero + 1; 91 | } 92 | else 93 | { 94 | set countOne = countOne + 1; 95 | } 96 | Reset(qubit); 97 | } 98 | Message("Rz(PI(), qubit):"); 99 | Message("CountZero: " + Convert.IntAsString(countZero)); 100 | Message("CountOne: " + Convert.IntAsString(countOne)); 101 | 102 | // Ry(PI()/2.0, qubit); 103 | // Same as H 104 | set countZero = 0; 105 | set countOne = 0; 106 | for i in 1..iterations 107 | { 108 | Ry(PI()/2.0, qubit); 109 | let result = M(qubit); 110 | if(IsResultZero(result)) 111 | { 112 | set countZero = countZero + 1; 113 | } 114 | else 115 | { 116 | set countOne = countOne + 1; 117 | } 118 | Reset(qubit); 119 | } 120 | Message("Ry(PI()/2.0, qubit):"); 121 | Message("CountZero: " + Convert.IntAsString(countZero)); 122 | Message("CountOne: " + Convert.IntAsString(countOne)); 123 | 124 | // R(PauliX, PI()/2.0, qubit); 125 | set countZero = 0; 126 | set countOne = 0; 127 | for i in 1..iterations 128 | { 129 | // PauliX and PauliZ can also be used; They are similar to Rx, Ry, Rz. 130 | R(PauliY, PI()/2.0, qubit); 131 | let result = M(qubit); 132 | if(IsResultZero(result)) 133 | { 134 | set countZero = countZero + 1; 135 | } 136 | else 137 | { 138 | set countOne = countOne + 1; 139 | } 140 | Reset(qubit); 141 | } 142 | Message("R(PauliY, PI()/2.0, qubit):"); 143 | Message("CountZero: " + Convert.IntAsString(countZero)); 144 | Message("CountOne: " + Convert.IntAsString(countOne)); 145 | 146 | // R1(PI(), qubit); 147 | // Zero will remain as Zero; This is same as Rz. We are changing only the phase of One 148 | set countZero = 0; 149 | set countOne = 0; 150 | for i in 1..iterations 151 | { 152 | R1(PI(), qubit); 153 | let result = M(qubit); 154 | if(IsResultZero(result)) 155 | { 156 | set countZero = countZero + 1; 157 | } 158 | else 159 | { 160 | set countOne = countOne + 1; 161 | } 162 | Reset(qubit); 163 | } 164 | Message("R1(PI(), qubit):"); 165 | Message("CountZero: " + Convert.IntAsString(countZero)); 166 | Message("CountOne: " + Convert.IntAsString(countOne)); 167 | 168 | // Ry(angle, qubit). 169 | // 1/4 probabilityOfZero. 170 | set countZero = 0; 171 | set countOne = 0; 172 | for i in 1..iterations 173 | { 174 | let probabilityOfZero = 1.0/4.0; 175 | let amplitudeOfZero = Sqrt(probabilityOfZero); 176 | let angle = 2.0 * ArcCos(amplitudeOfZero); 177 | Ry(angle, qubit); 178 | let result = M(qubit); 179 | if(IsResultZero(result)) 180 | { 181 | set countZero = countZero + 1; 182 | } 183 | else 184 | { 185 | set countOne = countOne + 1; 186 | } 187 | Reset(qubit); 188 | } 189 | Message("Ry(angle, qubit):"); 190 | Message("CountZero: " + Convert.IntAsString(countZero)); 191 | Message("CountOne: " + Convert.IntAsString(countOne)); 192 | 193 | 194 | } 195 | } 196 | 197 | -------------------------------------------------------------------------------- /QuantumComputingViaQSharpSolution/19_Demo Entanglement/19_Demo Entanglement.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | netcoreapp3.1 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /QuantumComputingViaQSharpSolution/19_Demo Entanglement/Program.qs: -------------------------------------------------------------------------------- 1 | namespace Quantum._19_Demo_Entanglement { 2 | 3 | open Microsoft.Quantum.Canon; 4 | open Microsoft.Quantum.Intrinsic; 5 | open Microsoft.Quantum.Measurement; 6 | open Microsoft.Quantum.Convert; 7 | open Microsoft.Quantum.Arrays; 8 | 9 | 10 | @EntryPoint() 11 | operation Demo_Entanglement () : Unit { 12 | mutable iterations = 20; 13 | 14 | use qubits = Qubit[2] 15 | { 16 | for i in 1..iterations 17 | { 18 | H(qubits[0]); 19 | CNOT(qubits[0],qubits[1]); 20 | 21 | mutable results = MultiM(qubits); 22 | 23 | //The output will always be 0-0 or 1-1, and can never be 0-1 or 1-0, those possibilities will be eliminated. 24 | Message("Output: " + IntAsString(ResultArrayAsInt(Subarray([0],results))) + "-" + 25 | IntAsString(ResultArrayAsInt(Subarray([1],results)))); 26 | 27 | ResetAll(qubits); 28 | } 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /QuantumComputingViaQSharpSolution/20_Demo Teleportation/20_Demo Teleportation.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | netcoreapp3.1 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /QuantumComputingViaQSharpSolution/20_Demo Teleportation/Program.qs: -------------------------------------------------------------------------------- 1 | namespace Quantum._20_Demo_Teleportation { 2 | 3 | open Microsoft.Quantum.Canon; 4 | open Microsoft.Quantum.Intrinsic; 5 | open Microsoft.Quantum.Math; 6 | open Microsoft.Quantum.Convert; 7 | 8 | @EntryPoint() 9 | operation HelloQ () : Unit { 10 | mutable iterations = 1000; 11 | mutable countZero = 0; 12 | mutable countOne = 0; 13 | 14 | // Circuit diagram located here. 15 | // https://www.media.mit.edu/quanta/qasm2circ/test2.png 16 | use qubits = Qubit[3]; 17 | 18 | let sourceQubit = qubits[0]; 19 | let tempQubit = qubits[1]; 20 | let destinationQubit = qubits[2]; 21 | 22 | // iterations needed only for testing. 23 | for i in 1..iterations 24 | { 25 | // Setting the sourceQubit in such a way that it has 25% probabilityOfZero. 26 | let probabilityOfZero = 1.0/4.0; 27 | let amplitudeOfZero = Sqrt(probabilityOfZero); 28 | let angle = 2.0 * ArcCos(amplitudeOfZero); 29 | Rx(angle, qubits[0]); 30 | 31 | // Teleportation start. 32 | H(tempQubit); 33 | CNOT(tempQubit, destinationQubit); 34 | CNOT(sourceQubit, tempQubit); 35 | H(sourceQubit); 36 | 37 | let resultSource = M(sourceQubit); 38 | let resultTemp = M(tempQubit); 39 | 40 | if(resultTemp == One) 41 | { 42 | X(destinationQubit); 43 | } 44 | 45 | if(resultSource == One) 46 | { 47 | Z(destinationQubit); 48 | } 49 | // Teleportation completed in the above step. 50 | 51 | // Following code tests if the Teleportation succeded or not. 52 | let resultDestination = M(destinationQubit); 53 | 54 | if(resultDestination == Zero) 55 | { 56 | set countZero = countZero + 1; 57 | } 58 | else 59 | { 60 | set countOne = countOne + 1; 61 | } 62 | 63 | ResetAll(qubits); 64 | } 65 | 66 | // CountZero should be close to 250 and CountOne should be close to 750. 67 | Message("CountZero:" + IntAsString(countZero)); 68 | Message("CountOne:" + IntAsString(countOne)); 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /QuantumComputingViaQSharpSolution/21_Demo Deutsch's Algorithm/21_Demo Deutsch's Algorithm.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | netcoreapp3.1 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /QuantumComputingViaQSharpSolution/21_Demo Deutsch's Algorithm/Program.qs: -------------------------------------------------------------------------------- 1 | namespace Quantum._21_Demo_Deutsch_s_Algorithm { 2 | 3 | open Microsoft.Quantum.Canon; 4 | open Microsoft.Quantum.Intrinsic; 5 | 6 | 7 | @EntryPoint() 8 | operation Demo_Deutsch_s_Algorithm () : Unit { 9 | 10 | //Circuit diagram located here 11 | //https://www.researchgate.net/profile/Piotr_Gawron/publication/250802186/figure/fig2/AS:298189887426561@1448105417119/Graphical-representation-of-Deutsch-algorithm.png 12 | 13 | use qubits = Qubit[2]; 14 | 15 | 16 | //Making the second qubit 1 17 | X(qubits[1]); 18 | 19 | //H on both 20 | ApplyToEach(H,qubits); 21 | 22 | //Apply the blackbox 23 | //blackbox will set y = f(x) XOR y; which is same as CNOT(f(x),y) 24 | BlackBoxConstant0(qubits); 25 | //BlackBoxConstant1(qubits); 26 | //BlackBoxBalancedSame(qubits); 27 | //BlackBoxBalancedDifferent(qubits); 28 | 29 | //H on the first qubit 30 | H(qubits[0]); 31 | 32 | //Measuring the first Qubit 33 | let result = M(qubits[0]); 34 | 35 | //For BlackBoxConstant0 and BlackBoxConstant1, the output will be Zero 36 | if(result == Zero) 37 | { 38 | Message("Constant"); 39 | } 40 | elif(result == One) 41 | //For BlackBoxBalancedSame and BlackBoxBalancedDifferent, the output will be One 42 | { 43 | Message("Balanced"); 44 | } 45 | 46 | ResetAll(qubits); 47 | 48 | } 49 | 50 | //This BB will always return 0 51 | //This implemenents y = f(x) XOR y; which is same as CNOT(f(x), y); 52 | //since f(x) = 0, for x = 0 and x = 1, we don't have to change y 53 | //x will be the first qubit; y will be the second qubit; 54 | operation BlackBoxConstant0(qubits:Qubit[]) : Unit 55 | { 56 | 57 | } 58 | 59 | //This BB will always return 1 60 | //This implemenents y = f(x) XOR y; which is same as CNOT(f(x), y); 61 | //since f(x) = 1, for x = 0 and x = 1, we need to do y = 1 XOR y, which is same as CNOT(1,y) 62 | //So it's enough to flip y every time 63 | //x will be the first qubit; y will be the second qubit; 64 | operation BlackBoxConstant1(qubits:Qubit[]) : Unit 65 | { 66 | 67 | X(qubits[1]); 68 | 69 | } 70 | 71 | //This BB will output 0 if the input is 0 72 | // and outputs 1 if the input is 1 73 | //This implemenents y = f(x) XOR y; which is same as CNOT(f(x), y); 74 | //Here f(x) = 0, for x = 0 and f(x) = 1 for x = 1, we need to do y = f(x) XOR y, which is same as CNOT(f(x),y) 75 | //Since f(x) = x, we need to do y = x XOR y, which is same ase CNOT(x,y) 76 | //x will be the first qubit; y will be the second qubit; 77 | operation BlackBoxBalancedSame(qubits:Qubit[]) : Unit 78 | { 79 | 80 | CNOT(qubits[0],qubits[1]); 81 | 82 | } 83 | 84 | //This BB will output 0 if the input is 1 85 | // and outputs 0 if the input is 1 86 | //This implemenents y = f(x) XOR y; which is same as CNOT(f(x), y); 87 | //Here f(x) = 1, for x = 0 and f(x) = 0 for x = 1, we need to do y = f(x) XOR y, which is same as CNOT(f(x),y) 88 | //Since f(x) = Not x, we need to do y = (NOT x) XOR y, which is same ase CNOT(X(x),y) 89 | //x will be the first qubit; y will be the second qubit; 90 | operation BlackBoxBalancedDifferent(qubits:Qubit[]) : Unit 91 | { 92 | X(qubits[0]); 93 | CNOT(qubits[0],qubits[1]); 94 | 95 | } 96 | } 97 | -------------------------------------------------------------------------------- /QuantumComputingViaQSharpSolution/22_Demo Grover's Algorithm Classical Simulation/22_Demo Grover's Algorithm Classical Simulation.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | netcoreapp3.1 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /QuantumComputingViaQSharpSolution/22_Demo Grover's Algorithm Classical Simulation/GroversAlgorithmClassicalSimulation.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.Quantum.Simulation.Core; 2 | using Microsoft.Quantum.Simulation.Simulators; 3 | using System; 4 | using System.Linq; 5 | 6 | namespace Quantum._22_Demo_Grover_s_Algorithm_Classical_Simulation 7 | { 8 | class Driver 9 | { 10 | //This program has no Q# code as it is only a simulation to demostrate the Grover's algo 11 | static void Main(string[] args) 12 | { 13 | int numberOfStates = (int)Math.Pow(2, 4); 14 | int numberBeingSearched = 9; 15 | double[] amplitudesOfAllTheStates = new double[numberOfStates]; 16 | 17 | //Initiatlly, there will be an amplitude of 1 for |0000>, and 0 for all others. 18 | amplitudesOfAllTheStates[0] = 1; 19 | Console.WriteLine("We are searching for 9 in this example, so observe the changes to the amplitude of 9."); 20 | Console.WriteLine("\nInitial Amplitudes:"); 21 | for (int i = 0; i < amplitudesOfAllTheStates.Length; i++) 22 | { 23 | Console.Write(i + ": " + Math.Round(amplitudesOfAllTheStates[i], 2) + "; "); 24 | } 25 | 26 | //Apply H on all the 4 qubits. 27 | //This will change the amplitudes of all the qubits to 1/Sqrt(numberOfStates) 28 | for (int i = 0; i < amplitudesOfAllTheStates.Length; i++) 29 | { 30 | amplitudesOfAllTheStates[i] = 1 / Math.Sqrt(numberOfStates); 31 | } 32 | 33 | //Will be uploading a video soon to give proof for this 34 | int numberOfIterationsNeeded = (int)Math.Round( 35 | ( 36 | Math.PI 37 | / 38 | ( 39 | 4.0 40 | * 41 | Math.Asin(1.0 / Math.Sqrt(numberOfStates)) 42 | ) 43 | ) - 0.5); 44 | 45 | Console.WriteLine("\n\nAmplitudes after applying H on all the Qubits:"); 46 | for (int i = 0; i < amplitudesOfAllTheStates.Length; i++) 47 | { 48 | Console.Write(i + ": " + Math.Round(amplitudesOfAllTheStates[i], 2) + "; "); 49 | } 50 | 51 | //Observe the amplitudes at the end of each iteration. 52 | for (int i = 0; i < numberOfIterationsNeeded; i++) 53 | { 54 | 55 | //Step 1 56 | //Flip the amplitude of the state we are searching for 57 | amplitudesOfAllTheStates[numberBeingSearched] = -1 * amplitudesOfAllTheStates[numberBeingSearched]; 58 | Console.WriteLine("\n\nAmplitudes after iteration " + (i + 1) + " Step 1 (flipping the amplitude of required number):"); 59 | //Final amplitudes. 60 | //The amplitude will be close to 1 for the number we are searching for; 9 in this case 61 | //All other amplitudes will be close to 0. 62 | for (int k = 0; k < amplitudesOfAllTheStates.Length; k++) 63 | { 64 | Console.Write(k + ": " + Math.Round(amplitudesOfAllTheStates[k], 2) + "; "); 65 | } 66 | 67 | //Step 2 68 | //Reflect each amplitude over the mean. 69 | //Mathematically this is same as newAmplitude = 2 * mean - oldAmplitude 70 | var meanOfAllAmplitudes = amplitudesOfAllTheStates.Average(); 71 | for (int j = 0; j < amplitudesOfAllTheStates.Length; j++) 72 | { 73 | amplitudesOfAllTheStates[j] = 2 * meanOfAllAmplitudes - amplitudesOfAllTheStates[j]; 74 | } 75 | 76 | Console.WriteLine("\n\nAmplitudes after iteration " + (i + 1) + " Step 2 (newAplitude = 2 * meanOfAllAmplitudes - oldAmplitude):"); 77 | //Final amplitudes. 78 | //The amplitude will be close to 1 for the number we are searching for; 9 in this case 79 | //All other amplitudes will be close to 0. 80 | for (int k = 0; k < amplitudesOfAllTheStates.Length; k++) 81 | { 82 | Console.Write(k + ": " + Math.Round(amplitudesOfAllTheStates[k], 2) + "; "); 83 | } 84 | 85 | } 86 | 87 | Console.WriteLine("\n\nFinal Amplitudes:"); 88 | //Final amplitudes. 89 | //The amplitude will be close to 1 for the number we are searching for; 9 in this case 90 | //All other amplitudes will be close to 0. 91 | for (int i = 0; i < amplitudesOfAllTheStates.Length; i++) 92 | { 93 | Console.Write(i + ": " + Math.Round(amplitudesOfAllTheStates[i], 2) + "; "); 94 | } 95 | 96 | Console.WriteLine("\n\nDone"); 97 | Console.ReadLine(); 98 | } 99 | } 100 | } -------------------------------------------------------------------------------- /QuantumComputingViaQSharpSolution/22_Demo Grover's Algorithm Classical Simulation/Program.qs: -------------------------------------------------------------------------------- 1 | namespace _22_Demo_Grover_s_Algorithm_Classical_Simulation { 2 | 3 | open Microsoft.Quantum.Canon; 4 | open Microsoft.Quantum.Intrinsic; 5 | 6 | 7 | @EntryPoint() 8 | operation HelloQ() : Unit { 9 | Message("Hello quantum world!"); 10 | } 11 | } 12 | 13 | -------------------------------------------------------------------------------- /QuantumComputingViaQSharpSolution/23_Demo Grover's Algorithm/23_Demo Grover's Algorithm.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | netcoreapp3.1 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /QuantumComputingViaQSharpSolution/23_Demo Grover's Algorithm/Program.qs: -------------------------------------------------------------------------------- 1 | namespace Quantum._23_Demo_Grover_s_Algorithm { 2 | 3 | open Microsoft.Quantum.Canon; 4 | open Microsoft.Quantum.Intrinsic; 5 | open Microsoft.Quantum.Arrays; 6 | open Microsoft.Quantum.Convert; 7 | open Microsoft.Quantum.Math; 8 | open Microsoft.Quantum.Measurement; 9 | 10 | @EntryPoint() 11 | operation HelloQ () : Unit { 12 | 13 | //We are trying to simulate the Grover's algo for a 5 qubit system. 14 | //We are trying to find 10100 15 | //If we measure the system at the end of the algorithem, we should get 10100 16 | let pattern = [true, false, true, false, false]; 17 | 18 | GenericGroversAlgo(5, pattern); 19 | } 20 | 21 | operation GetNumberOfIterations (n: Double): (Double) 22 | { 23 | mutable root = 1.0; 24 | set root = 1.0/Sqrt(n); 25 | mutable angle = 1.0; 26 | mutable pi = PI(); 27 | set angle = (PI()/(4.0* ArcSin(root))) - 0.5; 28 | return angle; 29 | } 30 | 31 | //The blackbox is implemented here. 32 | //This is a generic black box that flips the extraBit only if the qubits match the controlString 33 | operation GenericFlip(qubits: Qubit[], controlString: Bool[], extraBit: Qubit, n: Int) : Unit 34 | { 35 | //Changing the qubits to 1 whereever we have 0 36 | for i in 0..n-1 37 | { 38 | if(controlString[i] == false) 39 | { 40 | X(qubits[i]); 41 | } 42 | } 43 | 44 | //Flipping the extraBit; Now, X will be applieed only if bits match the controlString 45 | (Controlled X)(qubits, extraBit); 46 | 47 | //Undoing the changes we made in the first for loop 48 | for i in 0..n-1 49 | { 50 | if(controlString[i] == false) 51 | { 52 | X(qubits[i]); 53 | } 54 | } 55 | } 56 | 57 | //This will reflect the amplitudes about the meain. 58 | //A video will be uploaded to explain this logic 59 | operation GenericReflectionAboutMean(qubits: Qubit[], extraBit: Qubit) : Unit 60 | { 61 | //Change of bases so that |00000> aligns with H*H*H*H*H(|00000>) 62 | ApplyToEach(H, qubits); 63 | 64 | //Flip the extraBit only for the states != |00000> 65 | ApplyToEach(X, qubits);//This will make |00000> to |11111> 66 | X(extraBit);//This will always flip the extraBit 67 | (Controlled X)(qubits, extraBit);//This will flip only if the state is |11111>, this step and above step will effectively 68 | 69 | //Ensure that except for |00000>, all other states's amplitudes will be negated 70 | ApplyToEach(X, qubits);//This will undo the above ApplyToEach 71 | 72 | //Undoing the basis change 73 | ApplyToEach(H, qubits); 74 | } 75 | 76 | //n is the numer of qubits we are using 77 | //pattern is the number we are trying to search 78 | operation GenericGroversAlgo (n: Int, pattern: Bool[]) : Unit 79 | { 80 | use qubits = Qubit[n]; 81 | use extraBit = Qubit[1]; 82 | ApplyToEach(H, qubits); 83 | 84 | X(extraBit[0]); 85 | H(extraBit[0]); 86 | 87 | mutable iter = 1; 88 | set iter = Round(GetNumberOfIterations(PowD(IntAsDouble(n),2.0))); 89 | 90 | for i in 1..iter 91 | { 92 | GenericFlip(qubits, pattern, extraBit[0], n); 93 | GenericReflectionAboutMean(qubits, extraBit[0]); 94 | } 95 | 96 | //Measuing the system and generating a binary string 97 | mutable str = ""; 98 | let results = MultiM(qubits); 99 | for i in 0..Length(qubits)-1 100 | { 101 | set str = str + IntAsString(ResultArrayAsInt([results[i]])); 102 | } 103 | Message("State of the system at the end of " + IntAsString(iter) + " iterations:"); 104 | Message(str); 105 | 106 | ResetAll(qubits); 107 | ResetAll(extraBit); 108 | } 109 | } 110 | -------------------------------------------------------------------------------- /QuantumComputingViaQSharpSolution/24_Demo Quantm Circuit for Entangled Addition/24_Demo Quantm Circuit for Entangled Addition.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | netcoreapp3.1 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /QuantumComputingViaQSharpSolution/24_Demo Quantm Circuit for Entangled Addition/Program.qs: -------------------------------------------------------------------------------- 1 | namespace _24_Demo_Quantm_Circuit_for_Entangled_Addition_New { 2 | 3 | open Microsoft.Quantum.Canon; 4 | open Microsoft.Quantum.Intrinsic; 5 | open Microsoft.Quantum.Measurement; 6 | open Microsoft.Quantum.Convert as Convert; 7 | 8 | 9 | @EntryPoint() 10 | operation HelloQ() : Unit { 11 | mutable strSum = ""; 12 | // First Number 13 | use a = Qubit[2]; 14 | 15 | // Second Number 16 | use b = Qubit[2]; 17 | 18 | // sum will be a 3 bit number that stores the sum of a and b along with carry. 19 | use sum = Qubit[3]; 20 | 21 | ApplyToEach(H, a+b); 22 | 23 | // First qubit 24 | CNOT(a[0], sum[0]); 25 | CNOT(b[0], sum[0]); 26 | 27 | // Second qubit 28 | CNOT(a[1], sum[1]); 29 | CNOT(b[1], sum[1]); 30 | CCNOT(a[0], b[0], sum[1]); 31 | 32 | // Third qubit 33 | CCNOT(a[1], b[1], sum[2]); 34 | X(a[1]); 35 | (Controlled X)(a + b,sum[2]); 36 | X(a[1]); 37 | X(b[1]); 38 | (Controlled X)(a + b,sum[2]); 39 | X(b[1]); 40 | 41 | set strSum = Convert.IntAsString(Convert.ResultArrayAsInt(MultiM(sum))); 42 | 43 | // Change this number to see various superpositions 44 | if(strSum == "4") 45 | { 46 | // We can see that the input is entangled with the output. 47 | // If the output is 4, then only entangled states 2 + 2, 1 + 3 and 3 + 3 48 | // will remain and all other states will vanish from the input bits. 49 | Message(strSum + " : " + 50 | Convert.IntAsString(Convert.ResultArrayAsInt(MultiM(a))) + " + " + 51 | Convert.IntAsString(Convert.ResultArrayAsInt(MultiM(b))) 52 | ); 53 | } 54 | 55 | ResetAll(sum); 56 | 57 | ResetAll(b); 58 | 59 | 60 | ResetAll(a); 61 | 62 | 63 | } 64 | } 65 | 66 | -------------------------------------------------------------------------------- /QuantumComputingViaQSharpSolution/25_Demo Shor's Algorithm Classical Simulation/25_Demo_Shor_s_Algorithm_Classical_Simulation.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | netcoreapp3.1 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /QuantumComputingViaQSharpSolution/25_Demo Shor's Algorithm Classical Simulation/Program.qs: -------------------------------------------------------------------------------- 1 | namespace Quantum._25_Demo_Shor_s_Algorithm_Classical_Simulation { 2 | 3 | open Microsoft.Quantum.Canon; 4 | open Microsoft.Quantum.Intrinsic; 5 | 6 | 7 | @EntryPoint() 8 | operation HelloQ () : Unit { 9 | Message("Hello quantum world!"); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /QuantumComputingViaQSharpSolution/25_Demo Shor's Algorithm Classical Simulation/Shor_s_Algorithm.cs: -------------------------------------------------------------------------------- 1 | namespace _25_Demo_Shor_s_Algorithm_Classical_Simulation 2 | { 3 | using System; 4 | using System.Numerics; 5 | 6 | class Shor_s_Algorithm 7 | { 8 | // This is only a classical simulation for Shor's algo just for demonstration. 9 | // So there will not be any Q# code. 10 | static void Main(string[] args) 11 | { 12 | BigInteger N = 15; // Number we are trying to factorize. 13 | BigInteger Q = 256; // Next highest power of 2 nearest to N^2 (225) 14 | BigInteger a = 7; // 7 is co-prime of 15. a should be a random number less than 15 that is also a co-prime of 15 15 | 16 | var arrAmp = new Complex[(int)Q]; 17 | var arrModExp = new BigInteger[arrAmp.Length]; 18 | 19 | // Initial amplitudes after applying H on all the bits 20 | for (int i = 0; i < arrAmp.Length; i++) 21 | { 22 | arrAmp[i] = 1 / Math.Sqrt(arrAmp.Length); 23 | } 24 | 25 | // Calculating a ^ x Mod N for all Q entries 26 | for (int i = 0; i < arrModExp.Length; i++) 27 | { 28 | arrModExp[i] = BigInteger.ModPow(a, i, N); 29 | } 30 | 31 | double count4 = 0; 32 | 33 | // Let's say we found 4 as output. 34 | for (int i = 0; i < arrModExp.Length; i++) 35 | { 36 | if (arrModExp[i] == 4) 37 | { 38 | count4++; 39 | } 40 | } 41 | 42 | // Calculating the probability of getting 4 43 | var prob4 = ((double)1) / count4; 44 | 45 | // Calculating the amplitude. Seeting the non-4 amplitues to zero 46 | for (int i = 0; i < arrAmp.Length; i++) 47 | { 48 | if (arrModExp[i] == 4) 49 | { 50 | arrAmp[i] = Math.Sqrt(prob4); 51 | } 52 | else 53 | { 54 | arrAmp[i] = 0; 55 | } 56 | } 57 | 58 | // Calculating QFT 59 | var arrAmpQFT = new Complex[arrAmp.Length]; 60 | 61 | for (int i = 0; i < arrAmpQFT.Length; i++) 62 | { 63 | Complex tempSum = 0; 64 | for (int j = 0; j < arrAmp.Length; j++) 65 | { 66 | tempSum = tempSum + (arrAmp[j] * Complex.Exp(((double)2) * Math.PI * Complex.ImaginaryOne * ((double)i) * ((double)j) / ((double)Q))); 67 | } 68 | arrAmpQFT[i] = tempSum / Math.Sqrt((double)Q); 69 | } 70 | 71 | double totalProb = 0; 72 | for (int i = 0; i < arrAmpQFT.Length; i++) 73 | { 74 | totalProb = totalProb + Math.Pow(arrAmpQFT[i].Magnitude, 2); 75 | } 76 | 77 | // If this is one, the above code is correct 78 | Console.WriteLine("Total Probability: " + totalProb); 79 | 80 | for (int i = 0; i < arrModExp.Length; i++) 81 | { 82 | Console.WriteLine(i + " - " + 83 | arrModExp[i] + " - " + 84 | arrAmp[i].Magnitude + " - " + 85 | arrAmpQFT[i].Magnitude + " - " + 86 | (arrAmpQFT[i].Magnitude > 0.1 ? arrAmpQFT[i].Magnitude : 0)); 87 | } 88 | 89 | for (int i = 0; i < arrModExp.Length; i++) 90 | { 91 | if (arrAmpQFT[i].Magnitude > 0.1) 92 | { 93 | Console.WriteLine(i + " - " + 94 | arrModExp[i] + " - " + 95 | arrAmp[i].Magnitude + " - " + 96 | arrAmpQFT[i].Magnitude + " - " + 97 | arrAmpQFT[i].Magnitude); 98 | } 99 | } 100 | 101 | // We will get multiples of 64 as output. 102 | // x = L * (Q / r) // Here x is the measured output// L could be 0, 1, 2... 103 | // In the above equation we know x and Q and we need r 104 | // x/Q = L/r 105 | // We might have to run the quantum algo a few times to find the correct answer 106 | // We should discard r if r is odd 107 | // We should discard r if N divies a^(r/2)-1 or a^(r/2) + 1 108 | // From which we can find r; r = 4 in this case 109 | // GCD of a^r/2 - 1, 15 and a^r/2 + 1, 15 will result in 3 and 5 which is the required answer 110 | // If you don't get the answer, try with multiples of r for a few times. If you still don't get, then restart the algo with a different a 111 | Console.WriteLine("Done"); 112 | Console.ReadLine(); 113 | } 114 | } 115 | } 116 | -------------------------------------------------------------------------------- /QuantumComputingViaQSharpSolution/26_Demo Deutsch_Jozsa algorithm/26_Demo Deutsch_Jozsa algorithm.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | netcoreapp3.1 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /QuantumComputingViaQSharpSolution/26_Demo Deutsch_Jozsa algorithm/Program.qs: -------------------------------------------------------------------------------- 1 | namespace Quantum._26_Demo_Deutsch_Jozsa_algorithm { 2 | 3 | open Microsoft.Quantum.Canon; 4 | open Microsoft.Quantum.Intrinsic; 5 | open Microsoft.Quantum.Measurement; 6 | open Microsoft.Quantum.Convert; 7 | 8 | @EntryPoint() 9 | operation HelloQ () : Unit { 10 | 11 | use inputQubits = Qubit[3]; 12 | // Apply H on all the input Qubits 13 | ApplyToEach(H, inputQubits); 14 | 15 | use outputQubit = Qubit(); 16 | // Creating |-> 17 | X(outputQubit); 18 | H(outputQubit); 19 | 20 | // Applying the relevant black box; 21 | BlackBoxConstant0(inputQubits, outputQubit); 22 | // BlackBoxConstant1(inputQubits, outputQubit); 23 | // BlackBoxBalanced1(inputQubits, outputQubit); 24 | // BlackBoxBalanced2(inputQubits, outputQubit); 25 | 26 | // Apply H on all input Qubits 27 | ApplyToEach(H, inputQubits); 28 | 29 | let results = MultiM(inputQubits); 30 | let resultAsInt = ResultArrayAsInt(results); 31 | 32 | // For all Constant blackboxes, the probability of getting |000> is 1 33 | if(resultAsInt == 0) 34 | { 35 | Message("Constant"); 36 | } 37 | // For all Balanced blackboxes, the probability of getting |000> is 0 38 | else 39 | { 40 | Message("Balanced"); 41 | } 42 | 43 | Reset(outputQubit); 44 | ResetAll(inputQubits); 45 | } 46 | 47 | // Don't perform anything here. 48 | operation BlackBoxConstant0(inputQubits: Qubit[], outputQubit: Qubit) : Unit 49 | { 50 | } 51 | 52 | // Flip the output in all the scenarios 53 | operation BlackBoxConstant1(inputQubits: Qubit[], outputQubit: Qubit) : Unit 54 | { 55 | X(outputQubit); 56 | } 57 | 58 | // Flip the output only when the first qubit is 1 59 | operation BlackBoxBalanced1(inputQubits: Qubit[], outputQubit: Qubit) : Unit 60 | { 61 | CNOT(inputQubits[0], outputQubit); 62 | } 63 | 64 | // Flip the output only when the third qubit is 1 65 | operation BlackBoxBalanced2(inputQubits: Qubit[], outputQubit: Qubit) : Unit 66 | { 67 | 68 | CNOT(inputQubits[2], outputQubit); 69 | } 70 | 71 | //Flip only when we have 000, 010, 100, 110 72 | operation BlackBoxBalancedRandom1(inputQubits: Qubit[], outputQubits: Qubit[]) : Unit 73 | { 74 | 75 | //000 76 | X(inputQubits[0]); 77 | X(inputQubits[1]); 78 | X(inputQubits[2]); 79 | (Controlled X)(inputQubits, outputQubits[0]); 80 | X(inputQubits[0]); 81 | X(inputQubits[1]); 82 | X(inputQubits[2]); 83 | 84 | //010 85 | X(inputQubits[0]); 86 | X(inputQubits[2]); 87 | (Controlled X)(inputQubits, outputQubits[0]); 88 | X(inputQubits[0]); 89 | X(inputQubits[2]); 90 | 91 | //100 92 | X(inputQubits[1]); 93 | X(inputQubits[2]); 94 | (Controlled X)(inputQubits, outputQubits[0]); 95 | X(inputQubits[1]); 96 | X(inputQubits[2]); 97 | 98 | //110 99 | X(inputQubits[2]); 100 | (Controlled X)(inputQubits, outputQubits[0]); 101 | X(inputQubits[2]); 102 | 103 | } 104 | 105 | //Flip only when we have 001, 011, 101, 111 106 | operation BlackBoxBalancedRandom2(inputQubits: Qubit[], outputQubits: Qubit[]) : Unit 107 | { 108 | 109 | //001 110 | X(inputQubits[0]); 111 | X(inputQubits[1]); 112 | (Controlled X)(inputQubits, outputQubits[0]); 113 | X(inputQubits[0]); 114 | X(inputQubits[1]); 115 | 116 | //011 117 | X(inputQubits[0]); 118 | (Controlled X)(inputQubits, outputQubits[0]); 119 | X(inputQubits[0]); 120 | 121 | //101 122 | X(inputQubits[1]); 123 | (Controlled X)(inputQubits, outputQubits[0]); 124 | X(inputQubits[1]); 125 | 126 | //111 127 | (Controlled X)(inputQubits, outputQubits[0]); 128 | 129 | } 130 | } 131 | -------------------------------------------------------------------------------- /QuantumComputingViaQSharpSolution/27_Demo Simon's Algorithm/27_Demo Simon's Algorithm.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | netcoreapp3.1 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /QuantumComputingViaQSharpSolution/27_Demo Simon's Algorithm/Program.qs: -------------------------------------------------------------------------------- 1 | namespace Quantum._27_Demo_Simon_s_Algorithm { 2 | 3 | open Microsoft.Quantum.Canon; 4 | open Microsoft.Quantum.Intrinsic; 5 | open Microsoft.Quantum.Measurement; 6 | 7 | //Circuit is here: 8 | //https://en.wikipedia.org/wiki/Simon%27s_problem#/media/File:Simons_algorithm.svg 9 | @EntryPoint() 10 | operation Demo_Simon_s_Algorithm () : Unit { 11 | 12 | //Implementing the Simon's Algo for n = 4 13 | use inputQubits = Qubit[4]; 14 | 15 | //All output qubits will be initialized to 0 16 | use outputQubits = Qubit[4]; 17 | 18 | //Running the algorithm 20 times. 19 | //Ideally running it 3 times should be enough with good probability 20 | for(iter in 0..19) 21 | { 22 | //Creating equal superpostion for all the input qubits 23 | ApplyToEach(H, inputQubits); 24 | //Execute the blackbox 25 | //BlackBox0000(inputQubits, outputQubits); 26 | BlackBox1010(inputQubits, outputQubits); 27 | 28 | //Applying H again on all the input qubits 29 | ApplyToEach(H, inputQubits); 30 | 31 | let inputQubitsResults = MultiM(inputQubits); 32 | let outputQubitsResults = MultiM(outputQubits); 33 | 34 | //We should get Non-Zero vectors that are linearly independant with very good probability 35 | //that satisfy the condigion y.s = 0; i.e y1.s1 + y2.s2 + y3.s3 + y4.s4 = 0; here + is used to denote xor 36 | //There is still some probability of getting Zero vectors and linearly dependant vectors. 37 | //However, we will never get a vector that satisfies y.s = 1; 38 | Message(""); 39 | Message($"Iteration: {iter + 1}"); 40 | for(i in 0..3){ 41 | Message($"{inputQubitsResults[i]}"); 42 | } 43 | 44 | ResetAll(outputQubits); 45 | ResetAll(inputQubits); 46 | } 47 | 48 | //From the above for loop; we ignore the cases when we get 0000; 49 | //We ignore the cases where the vectors are linearly dependant; 50 | //We pick only those cases where the vectors are linearly independant (n-1) and solve them to find s; 51 | //Once we find the value of s, we need to evaluate the BlackBox for 0000 and s and if both the values are same 52 | //then we have found the solution; if they don't match then it means that s=0000 is the solution. 53 | 54 | //Algorithm ends above; following lines are just to test the black boxes by sending data without superposition. 55 | 56 | //Testing the blackbox for input=0000 57 | //BlackBox0000(inputQubits, outputQubits); 58 | //Output should be 0000 59 | BlackBox1010(inputQubits, outputQubits); 60 | //Output should be 0000 61 | let outputQubitsResults1 = MultiM(outputQubits); 62 | Message(""); 63 | Message("Testing the blackbox for input=0000"); 64 | for i in 0..3{ 65 | Message($"{outputQubitsResults1[i]}"); 66 | } 67 | ResetAll(outputQubits); 68 | ResetAll(inputQubits); 69 | 70 | //Testing the blackbox for input=1010; 71 | ApplyToEach(X,[inputQubits[0],inputQubits[2]]); 72 | //BlackBox0000(inputQubits, outputQubits); 73 | //Output should be same as input 1010 74 | BlackBox1010(inputQubits, outputQubits); 75 | //Output should be 0000 (same as that of the input 0000); because here s = 1010 76 | let outputQubitsResults2 = MultiM(outputQubits); 77 | Message(""); 78 | Message("Testing the blackbox for input=1010"); 79 | for i in 0..3{ 80 | Message($"{outputQubitsResults2[i]}"); 81 | } 82 | ResetAll(outputQubits); 83 | ResetAll(inputQubits); 84 | 85 | //Testing the blackbox for input=1110; 86 | ApplyToEach(X,[inputQubits[0],inputQubits[1], inputQubits[2]]); 87 | //BlackBox0000(inputQubits, outputQubits); 88 | //Output should be same as input 1110 89 | BlackBox1010(inputQubits, outputQubits); 90 | //Output should be 0100 91 | let outputQubitsResults3 = MultiM(outputQubits); 92 | Message(""); 93 | Message("Testing the blackbox for input=1110"); 94 | for i in 0..3{ 95 | Message($"{outputQubitsResults3[i]}"); 96 | } 97 | ResetAll(outputQubits); 98 | ResetAll(inputQubits); 99 | 100 | //Testing the blackbox for input=0100; 101 | ApplyToEach(X,[inputQubits[1]]); 102 | //BlackBox0000(inputQubits, outputQubits); 103 | //Output should be same as input 0100 104 | BlackBox1010(inputQubits, outputQubits); 105 | //Output should be 0100 (same as that of the input 1110; because s(1010) = 0100 xor 1110) 106 | let outputQubitsResults4 = MultiM(outputQubits); 107 | Message(""); 108 | Message("Testing the blackbox for input=0100"); 109 | for i in 0..3{ 110 | Message($"{outputQubitsResults4[i]}"); 111 | } 112 | ResetAll(outputQubits); 113 | ResetAll(inputQubits); 114 | 115 | ResetAll(outputQubits); 116 | ResetAll(inputQubits); 117 | 118 | 119 | 120 | } 121 | 122 | //This will create a 1-1 function and s=0000 123 | //Here we have choosen the function y=f(x) such that y = x; This need not be the case as long as the function is 1-1; 124 | operation BlackBox0000(inputQubits: Qubit[], outputQubits: Qubit[]): Unit{ 125 | 126 | CNOT(inputQubits[0], outputQubits[0]); 127 | CNOT(inputQubits[1], outputQubits[1]); 128 | CNOT(inputQubits[2], outputQubits[2]); 129 | CNOT(inputQubits[3], outputQubits[3]); 130 | 131 | } 132 | 133 | //This will create a 2-1 function and s=1010 134 | operation BlackBox1010(inputQubits: Qubit[], outputQubits: Qubit[]): Unit{ 135 | 136 | //Do nothing for 0000 and 1010 (output will be left as 0000) 137 | 138 | //output=0001 for the inputs 0001 and 1011 139 | ApplyToEach(X,[inputQubits[0],inputQubits[1],inputQubits[2]]); 140 | (Controlled X)(inputQubits,outputQubits[3]); 141 | ApplyToEach(X,[inputQubits[0],inputQubits[1],inputQubits[2]]); 142 | 143 | ApplyToEach(X,[inputQubits[1]]); 144 | (Controlled X)(inputQubits,outputQubits[3]); 145 | ApplyToEach(X,[inputQubits[1]]); 146 | 147 | //output=0010 for the inputs 0010 and 1000 148 | ApplyToEach(X,[inputQubits[0],inputQubits[1],inputQubits[3]]); 149 | (Controlled X)(inputQubits,outputQubits[2]); 150 | ApplyToEach(X,[inputQubits[0],inputQubits[1],inputQubits[3]]); 151 | 152 | ApplyToEach(X,[inputQubits[1],inputQubits[2],inputQubits[3]]); 153 | (Controlled X)(inputQubits,outputQubits[2]); 154 | ApplyToEach(X,[inputQubits[1],inputQubits[2],inputQubits[3]]); 155 | 156 | //output=0011 for the inputs 0011 and 1001 157 | ApplyToEach(X,[inputQubits[0],inputQubits[1]]); 158 | (Controlled X)(inputQubits,outputQubits[2]); 159 | (Controlled X)(inputQubits,outputQubits[3]); 160 | ApplyToEach(X,[inputQubits[0],inputQubits[1]]); 161 | 162 | ApplyToEach(X,[inputQubits[1],inputQubits[2]]); 163 | (Controlled X)(inputQubits,outputQubits[2]); 164 | (Controlled X)(inputQubits,outputQubits[3]); 165 | ApplyToEach(X,[inputQubits[1],inputQubits[2]]); 166 | 167 | //output=0100 for the inputs 0100 and 1110 168 | ApplyToEach(X,[inputQubits[0],inputQubits[2],inputQubits[3]]); 169 | (Controlled X)(inputQubits,outputQubits[1]); 170 | ApplyToEach(X,[inputQubits[0],inputQubits[2],inputQubits[3]]); 171 | 172 | ApplyToEach(X,[inputQubits[3]]); 173 | (Controlled X)(inputQubits,outputQubits[1]); 174 | ApplyToEach(X,[inputQubits[3]]); 175 | 176 | //output=0101 for the inputs 0101 and 1111 177 | ApplyToEach(X,[inputQubits[0],inputQubits[2]]); 178 | (Controlled X)(inputQubits,outputQubits[1]); 179 | (Controlled X)(inputQubits,outputQubits[3]); 180 | ApplyToEach(X,[inputQubits[0],inputQubits[2]]); 181 | 182 | //ApplyToEach(X,[]); 183 | (Controlled X)(inputQubits,outputQubits[1]); 184 | (Controlled X)(inputQubits,outputQubits[3]); 185 | //ApplyToEach(X,[]); 186 | 187 | //output=0110 for the inputs 0110 and 1100 188 | ApplyToEach(X,[inputQubits[0],inputQubits[3]]); 189 | (Controlled X)(inputQubits,outputQubits[1]); 190 | (Controlled X)(inputQubits,outputQubits[2]); 191 | ApplyToEach(X,[inputQubits[0],inputQubits[3]]); 192 | 193 | ApplyToEach(X,[inputQubits[2],inputQubits[3]]); 194 | (Controlled X)(inputQubits,outputQubits[1]); 195 | (Controlled X)(inputQubits,outputQubits[2]); 196 | ApplyToEach(X,[inputQubits[2],inputQubits[3]]); 197 | 198 | //output=0111 for the inputs 0111 and 1101 199 | ApplyToEach(X,[inputQubits[0]]); 200 | (Controlled X)(inputQubits,outputQubits[1]); 201 | (Controlled X)(inputQubits,outputQubits[2]); 202 | (Controlled X)(inputQubits,outputQubits[3]); 203 | ApplyToEach(X,[inputQubits[0]]); 204 | 205 | ApplyToEach(X,[inputQubits[2]]); 206 | (Controlled X)(inputQubits,outputQubits[1]); 207 | (Controlled X)(inputQubits,outputQubits[2]); 208 | (Controlled X)(inputQubits,outputQubits[3]); 209 | ApplyToEach(X,[inputQubits[2]]); 210 | 211 | } 212 | } 213 | -------------------------------------------------------------------------------- /SECURITY.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | ## Security 4 | 5 | Microsoft takes the security of our software products and services seriously, which includes all source code repositories managed through our GitHub organizations, which include [Microsoft](https://github.com/Microsoft), [Azure](https://github.com/Azure), [DotNet](https://github.com/dotnet), [AspNet](https://github.com/aspnet), [Xamarin](https://github.com/xamarin), and [our GitHub organizations](https://opensource.microsoft.com/). 6 | 7 | If you believe you have found a security vulnerability in any Microsoft-owned repository that meets [Microsoft's definition of a security vulnerability](https://aka.ms/opensource/security/definition), please report it to us as described below. 8 | 9 | ## Reporting Security Issues 10 | 11 | **Please do not report security vulnerabilities through public GitHub issues.** 12 | 13 | Instead, please report them to the Microsoft Security Response Center (MSRC) at [https://msrc.microsoft.com/create-report](https://aka.ms/opensource/security/create-report). 14 | 15 | If you prefer to submit without logging in, send email to [secure@microsoft.com](mailto:secure@microsoft.com). If possible, encrypt your message with our PGP key; please download it from the [Microsoft Security Response Center PGP Key page](https://aka.ms/opensource/security/pgpkey). 16 | 17 | You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your original message. Additional information can be found at [microsoft.com/msrc](https://aka.ms/opensource/security/msrc). 18 | 19 | Please include the requested information listed below (as much as you can provide) to help us better understand the nature and scope of the possible issue: 20 | 21 | * Type of issue (e.g. buffer overflow, SQL injection, cross-site scripting, etc.) 22 | * Full paths of source file(s) related to the manifestation of the issue 23 | * The location of the affected source code (tag/branch/commit or direct URL) 24 | * Any special configuration required to reproduce the issue 25 | * Step-by-step instructions to reproduce the issue 26 | * Proof-of-concept or exploit code (if possible) 27 | * Impact of the issue, including how an attacker might exploit the issue 28 | 29 | This information will help us triage your report more quickly. 30 | 31 | If you are reporting for a bug bounty, more complete reports can contribute to a higher bounty award. Please visit our [Microsoft Bug Bounty Program](https://aka.ms/opensource/security/bounty) page for more details about our active programs. 32 | 33 | ## Preferred Languages 34 | 35 | We prefer all communications to be in English. 36 | 37 | ## Policy 38 | 39 | Microsoft follows the principle of [Coordinated Vulnerability Disclosure](https://aka.ms/opensource/security/cvd). 40 | 41 | 42 | -------------------------------------------------------------------------------- /TOC.md: -------------------------------------------------------------------------------- 1 | ## TABLE OF CONTENTS 2 | 3 | Phase 1 Basic Quantum Concepts 4 | 5 | * [Introduction](./README.md) 6 | 7 | * [1.1 States](./1-Basic_Quantum_Concepts/1-States.ipynb) 8 | * [Vector notation](./1-Basic_Quantum_Concepts/1-States.ipynb#vectornotation) 9 | * [Classical bits](./1-Basic_Quantum_Concepts/1-States.ipynb#classicalbits) 10 | * [Quantum bits – qubits](./1-Basic_Quantum_Concepts/1-States.ipynb#quantumbits) 11 | * [Superposition](./1-Basic_Quantum_Concepts/1-States.ipynb#superposition) 12 | * [2-Norm approach](./1-Basic_Quantum_Concepts/1-States.ipynb#normapproach) 13 | * [Q# exercise: setup a Q# environment](./1-Basic_Quantum_Concepts/1-States.ipynb#qexercise) 14 | 15 | * [1.2 Gates](./1-Basic_Quantum_Concepts/2-Gates.ipynb) 16 | * [Unitary matrix](./1-Basic_Quantum_Concepts/2-Gates.ipynb#unitarymatrix) 17 | * [The Control-NOT Gate (CNOT)](./1-Basic_Quantum_Concepts/2-Gates.ipynb#cnot) 18 | * [Q# exercise: CNOT gate](./1-Basic_Quantum_Concepts/2-Gates.ipynb#qcnot) 19 | * [Circuit Representation](./1-Basic_Quantum_Concepts/2-Gates.ipynb#circuit) 20 | * [Hadamard Gate](./1-Basic_Quantum_Concepts/2-Gates.ipynb#hadamard) 21 | * [Q# exercise: H gate](./1-Basic_Quantum_Concepts/2-Gates.ipynb#qh) 22 | * [Bloch Sphere](./1-Basic_Quantum_Concepts/2-Gates.ipynb#boch) 23 | * [Pauli Gates](./1-Basic_Quantum_Concepts/2-Gates.ipynb#pauli) 24 | * [Q# exercise: Pauli gates](./1-Basic_Quantum_Concepts/2-Gates.ipynb#qpauli) 25 | * [Measurement](./1-Basic_Quantum_Concepts/2-Gates.ipynb#measurement) 26 | * [Q# exercise: Measurement using M operation](./1-Basic_Quantum_Concepts/2-Gates.ipynb#qmeasurement) 27 | * [Interference](./1-Basic_Quantum_Concepts/2-Gates.ipynb#interference) 28 | 29 | * [1.3 Entanglement](./1-Basic_Quantum_Concepts/3-Entanglement.ipynb) 30 | * [Bell states](./1-Basic_Quantum_Concepts/3-Entaglement.ipynb#bell) 31 | * [Entanglement](./1-Basic_Quantum_Concepts/3-Entaglement.ipynb#entanglement) 32 | * [Creating a Bell state](./1-Basic_Quantum_Concepts/3-Entaglement.ipynb#creating) 33 | * [Q# exercise: Bell States](./1-Basic_Quantum_Concepts/3-Entaglement.ipynb#qbell) 34 | * [Greenberger – Horne – Zeilinger](./1-Basic_Quantum_Concepts/3-Entaglement.ipynb#ghz) 35 | * [Q# exercise: GHZ](./1-Basic_Quantum_Concepts/3-Entaglement.ipynb#qghz) 36 | * [Superdense coding](./1-Basic_Quantum_Concepts/3-Entaglement.ipynb#superdense) 37 | * [Q# exercise: Superdense Coding](./1-Basic_Quantum_Concepts/3-Entaglement.ipynb#qsuperdense) 38 | * [Quirk](./1-Basic_Quantum_Concepts/3-Entaglement.ipynb#quirk) 39 | 40 | * [1.4 Teleportation](./1-Basic_Quantum_Concepts/4-Teleportation.ipynb) 41 | * [Q# exercise: Teleportation](./1-Basic_Quantum_Concepts/4-Teleportation.ipynb#qtransformation) 42 | * [Q# exercise: Another Teleportation Exercise](./1-Basic_Quantum_Concepts/4-Teleportation.ipynb#qtransformation2) 43 | 44 | * [1.5 The No-Cloning Theorem](./1-Basic_Quantum_Concepts/5-No-Cloning_Theorem.ipynb) 45 | 46 | * [1.6 The CHSH Game](./1-Basic_Quantum_Concepts/6-CHSH_Game.ipynb) 47 | * [Q# exercise: CHSH Game](./1-Basic_Quantum_Concepts/6-CHSH_Game.ipynb#qchsh) 48 | 49 | Phase 2 Quantum Algorithms 50 | * [2.1 Quantum Oracles](./2-Quantum_Algorithms/1-Quantum_Oracles.ipynb) 51 | * [Q# exercise: Oracles](./2-Quantum_Algorithms/1-Quantum_Oracles.ipynb#qexercise) 52 | 53 | * [2.2 Deutsch's Algorithm](./2-Quantum_Algorithms/2-Deutsch_s_Algorithm.ipynb) 54 | * [Q# exercise: Deutsch's algorithm](./2-Quantum_Algorithms/2-Deutsch_s_Algorithm.ipynb#qex) 55 | 56 | * [2.3 Deutsch-Jozsa Algorithm](./2-Quantum_Algorithms/3-Deutsch-Jozsa_Algorithm.ipynb) 57 | * [Q# exercise: Deutsch-Josza algorithm](./2-Quantum_Algorithms/3-Deutsch-Jozsa_Algorithm.ipynb#qex) 58 | 59 | * [2.4 Grover's Algorithm](./2-Quantum_Algorithms/4-Grover_s_Algorithm.ipynb) 60 | * [Q# exercise: Grover's algorithm](./2-Quantum_Algorithms/4-Grover_s_Algorithm.ipynb#qex) 61 | 62 | * [2.5 Simon's Algorithm](./2-Quantum_Algorithms/5-Simon_s_Algorithm.ipynb) 63 | * [Q# exercise: Simon's algorithm](./2-Quantum_Algorithms/5-Simon_s_Algorithm.ipynb#qex) 64 | 65 | * [2.6 Shor's Algorithm](./2-Quantum_Algorithms/6-Shor_s_Algorithm.ipynb) 66 | 67 | Phase 3 Quantum Hardware Systems 68 | * [3.1 Natural qubits](./3-Quantum_Hardware_Systems/1-Natural_Qubits.ipynb) 69 | * [3.2 Silicon quantum dots](./3-Quantum_Hardware_Systems/2-Silicon_Quantum_Dots.ipynb) 70 | * [3.3 Crystal defects](./3-Quantum_Hardware_Systems/3-Crystal_Defects.ipynb) 71 | * [3.4 Trapped ions](./3-Quantum_Hardware_Systems/4-Trapped_Ions.ipynb) 72 | * [3.5 Superconducting circuits](./3-Quantum_Hardware_Systems/5-Superconductin_Circuits.ipynb) 73 | * [3.6 Topological qubits](./3-Quantum_Hardware_Systems/6-Topological_Qubits.ipynb) 74 | 75 | Phase 4 Looking Ahead 76 | * [Cryptography and Quantum Computing](./LOOKING_AHEAD/1-Cryptography.ipynb) 77 | * [Standard Algorithms for Cryptography]() 78 | * [The impact of Quantum Computing on Cryptography]() 79 | * [How Shor's algorithm can affect cryptography?]() 80 | * [How do the quantum circuits for Shor's algorithm work?]() 81 | * [How Grover's algorithm can affect cryptography?]() 82 | * [How do the quantum circuits for Grover's algorithm work?]() 83 | * [Encryption in the post-Quantum era]() 84 | * [Mosca's Inequality equation]() 85 | * [Microsoft and Quantum Cryptography]() 86 | * [Post-Quantum Cryptography VPN]() 87 | * [Conclusion]() 88 | -------------------------------------------------------------------------------- /media/jupyter_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/Reference-Guide-For-Quantum-Computing-A-Microsoft-Garage-Project/c1533b9472cbfe09b0e15a964d0c6fd73a8831fe/media/jupyter_1.png -------------------------------------------------------------------------------- /media/jupyter_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/Reference-Guide-For-Quantum-Computing-A-Microsoft-Garage-Project/c1533b9472cbfe09b0e15a964d0c6fd73a8831fe/media/jupyter_2.png --------------------------------------------------------------------------------