Giter Club home page Giter Club logo

vqc's Introduction

VQC Logo

Build Status Coverage Status GitHub issues Contributions welcome License: MIT

Variational Quantum Circuit simulator in Julia, under GPLv3, developed with <3 by Supremacy Future Technologies.


Introduction:

VQC is an open source framework that can simulate variational quantum circuits and used for quantum machine learning tasks.

  • Simple but powerful. VQC supports any single-qubit, two-qubit, three-qubit gate operations, as well as measurements. The same quantum circuit can be used as variational quantum circuits almost for free.

  • Everything is differentiable. Not only the quantum circuit, the quantum state itself is also differentiable, almost without any changing of code. In most of the cases, user can write a very complex expression built on top of the quantum circuit and the quantum state, and the whole expression will be differentiable.

  • Flexiable operations on quantum gates and quantum circuits. Quantum circuit and quantum gates suport operations such as adjoint, transpose, conjugate, shift to make life easier when building very complex circuits.

  • Zygote as backend for auto differentiation. VQC use Zygote as backend for auto differentiation.

Comparisons between VQC and existing technologies:

Now at version 0.1.0!

Installation

VQC is a Julia language package. To install VQC, please open Julia's interactive session (known as REPL) and type

pkg> import Pkg; Pkg.add("VQC")

Example:

# Using functions from VQC
julia> using VQC

# Create a two qubit quantum state |00>
julia> state = qstate([0,0])
StateVector{Complex{Float64}}(Complex{Float64}[1.0 + 0.0im, 0.0 + 0.0im, 0.0 + 0.0im, 0.0 + 0.0im])

# Create and empty quantum circuit
julia> circuit = QCircuit()
QCircuit(VQC.AbstractQuantumOperation[])

# pushing gate operations into the quantum circuit
julia> push!(circuit, HGate(1))
1-element Array{VQC.AbstractQuantumOperation,1}:
 OneBodyGate{Array{Float64,2}}(1, [0.7071067811865475 0.7071067811865475; 0.7071067811865475 -0.7071067811865475])

# pushing measure operation into the quantum circuit
julia> push!(circuit, QMeasure(1)))
2-element Array{VQC.AbstractQuantumOperation,1}:
OneBodyGate{Array{Float64,2}}(1, [0.7071067811865475 0.7071067811865475; 0.7071067811865475 -0.7071067811865475])
QMeasure(1, true, true, [1.0 0.0; 0.0 1.0]) 

# apply quantum circuit to quantum state
julia> results = apply!(circuit, state)
2-element Observables:
 ("Q:Z1", 1)                    
 ("C:Z1->1", 0.4999999999999999)

# In "Q:Z1", Q means quantum observable, Z refer to the basis, 1 is the qubit label
# Similarly, in "C:Z1->1", C means classical observables, 0.4999.. means the probability
# Obtain all the measurement outcomes.
julia> qvalues(results)
1-element Array{Int64,1}:
 1

# Obtain all the measurement probabilities
julia> cvalues(results)
1-element Array{Float64,1}:
 0.4999999999999999

Tutorials

  1. Tutorial 1: Basic operations

Contact

You are welcome to leave your comment or suggestions as an issues. For commercial purpose, please email us at support [at] supremacyfuture.com

Citing VQC

Please cite the following paper when using VQC:

@article{liu2019hybrid,
  title={Hybrid Quantum-Classical Convolutional Neural Networks},
  author={Liu, Junhua and Lim, Kwan Hui and Wood, Kristin L and Huang, Wei and Guo, Chu and Huang, He-Liang},
  journal={arXiv preprint arXiv:1911.02998},
  year={2019}
}

License

VQC is published under GPLv3

Copyright (C) 2019 Supremacy Future Technologies

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see here.

vqc's People

Contributors

guochu avatar junhua avatar supremacyfuture avatar theagodzilla avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

vqc's Issues

error with Pkg.add("VQC") The following package names could not be resolved

Hello, when I try to install VQC using Pkg (import Pkg; Pkg.add("VQC")), the outputs are:

ERROR: The following package names could not be resolved:

  • VQC (not found in project, manifest or registry)
    Please specify by known name=uuid.
    Stacktrace:
    [1] pkgerror(::String) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.1/Pkg/src/Types.jl:120
    [2] #ensure_resolved#72(::Bool, ::Function, ::Pkg.Types.EnvCache, ::Array{Pkg.Types.PackageSpec,1}) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.1/Pkg/src/Types.jl:1010
    [3] #ensure_resolved at ./none:0 [inlined]
    [4] #add_or_develop#17(::Symbol, ::Bool, ::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}, ::Function, ::Pkg.Types.Context, ::Array{Pkg.Types.PackageSpec,1}) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.1/Pkg/src/API.jl:54

The version of my julia is 1.1. Thank you!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.