Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: Documentation & Doc tests #37

Closed
wants to merge 7 commits into from
Closed

WIP: Documentation & Doc tests #37

wants to merge 7 commits into from

Conversation

Roger-luo
Copy link
Member

@Roger-luo Roger-luo commented May 7, 2018

Examples will be added along with this PR.

@Roger-luo Roger-luo requested a review from GiggleLiu May 7, 2018 17:25
@Roger-luo Roger-luo added this to the v0.1 milestone May 7, 2018
@coveralls
Copy link

coveralls commented May 7, 2018

Pull Request Test Coverage Report for Build 274

  • 15 of 26 (57.69%) changed or added relevant lines in 7 files are covered.
  • 59 unchanged lines in 7 files lost coverage.
  • Overall coverage remained the same at 47.94%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/Blocks/RotationGate.jl 2 3 66.67%
src/Blocks/PhaseGate.jl 1 2 50.0%
src/Blocks/Control.jl 0 4 0.0%
src/Blocks/Core.jl 2 7 28.57%
Files with Coverage Reduction New Missed Lines %
src/Blocks/RotationGate.jl 1 83.33%
src/Blocks/PhaseGate.jl 1 71.43%
src/Blocks/KronBlock.jl 5 83.75%
src/Blocks/Control.jl 11 65.71%
src/Blocks/Composite.jl 11 0.0%
src/Blocks/Roller.jl 12 30.0%
src/PrettyInterface.jl 18 31.43%
Totals Coverage Status
Change from base Build 270: 0.0%
Covered Lines: 384
Relevant Lines: 801

💛 - Coveralls

@codecov-io
Copy link

codecov-io commented May 7, 2018

Codecov Report

Merging #37 into master will increase coverage by 6.71%.
The diff coverage is 84.61%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #37      +/-   ##
==========================================
+ Coverage   47.94%   54.65%   +6.71%     
==========================================
  Files          32       32              
  Lines         801      816      +15     
==========================================
+ Hits          384      446      +62     
+ Misses        417      370      -47
Impacted Files Coverage Δ
src/Blocks/Composite.jl 63.63% <ø> (+63.63%) ⬆️
src/Blocks/KronBlock.jl 90% <ø> (+6.25%) ⬆️
src/Blocks/RotationGate.jl 92.3% <100%> (+8.97%) ⬆️
src/Blocks/Roller.jl 65.62% <100%> (+35.62%) ⬆️
src/Blocks/ConstantGate.jl 93.33% <100%> (+0.47%) ⬆️
src/Blocks/PhaseGate.jl 88.88% <100%> (+17.46%) ⬆️
src/Blocks/Core.jl 55.55% <50%> (+26.98%) ⬆️
src/PrettyInterface.jl 34.21% <66.66%> (+2.78%) ⬆️
src/Blocks/Control.jl 81.08% <66.66%> (+15.36%) ⬆️
src/Cache/HashRules.jl 40% <0%> (-4%) ⬇️
... and 8 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 74939a9...1a37f65. Read the comment docs.

@GiggleLiu
Copy link
Member

What to support in the first generation developer's document

  • An example to construct GHZ,
  • An example to construct differentiable circuit (used in QCBM training),
  • How to extend an arbitray single qubit gate, with/without parameters and matrix type consideration,
  • Show the benchmark with respect to scipy, explain why it is faster.
  • How control, kron, chain and compose et. al. work, paste some test/benchmark is OK,

use the following command to build locally.

```sh
> julia make.jl loacl
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

local

# define the number of qubits
nqubits(::Type{GateType{:CNOT}}) = 2
# define its matrix form
sparse(::Gate{2, GateType{:CNOT}, T}) where T = T[1 0 0 0;0 1 0 0;0 0 0 1;0 0 1 0]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pin the memory for constant gate?

using QuCircuit
import QuCircuit: PrimitiveBlock, apply!, Register

struct GroverSearch{N, T} <: PrimitiveBlock{N, T}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use a concrete example, with parameter.

@@ -27,8 +27,7 @@ input it into the oracle. You will then receive this register after
processing it.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what do you mean by process? make the construction process explicit, i.e. from compose to its matrix form. Analyse in each step, how the wave function changes.

@Roger-luo Roger-luo closed this May 30, 2018
@Roger-luo Roger-luo deleted the document branch May 30, 2018 13:36
Roger-luo pushed a commit that referenced this pull request Dec 7, 2021
* more instructs

* add a test
Roger-luo pushed a commit that referenced this pull request Dec 7, 2021
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
GiggleLiu pushed a commit that referenced this pull request Apr 21, 2024
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
GiggleLiu added a commit that referenced this pull request Apr 21, 2024
* Initial commit

* Files generated by PkgTemplates

PkgTemplates version: 0.7.5

* plots for ZX-diagrams

* rename plot

* plots for ZX-diagrams (#10)

* plots for ZX-diagrams

* rename plot

* CompatHelper: add new compat entry for "Compose" at version "0.9" (#11)

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* CompatHelper: add new compat entry for "LightGraphs" at version "1.3" (#12)

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Rogerluo <rogerluo.rl18@gmail.com>

* CompatHelper: add new compat entry for "GraphPlot" at version "0.4" (#13)

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Rogerluo <rogerluo.rl18@gmail.com>

* CompatHelper: add new compat entry for "ZXCalculus" at version "0.1" (#15)

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Rogerluo <rogerluo.rl18@gmail.com>

* CompatHelper: add new compat entry for "Colors" at version "0.12" (#14)

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Rogerluo <rogerluo.rl18@gmail.com>

* rm logs

* fix compat

* CompatHelper: bump compat for "Compose" to "0.9" (#16)

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* update for new Multigraph backend

* update zx

* update project.toml

* update project.toml

* update compat

* revert version bump due to an error occured in IonCLI

* update compat

* bump version to 0.2.1

* bump version to 0.3.0

* fix version conflict

* fix version compat

* Basic circuit vizualization (#22)

* new circuit plot

* fine tune

* fine tune

* rm 1.0 travis CI

* make CNOT a CNOT

* general update

Co-authored-by: Rogerluo <rogerluo.rl18@gmail.com>

* bump version to 0.4.0

* Update TagBot.yml

* add compat

* add compat

* Polish code and fix #3 (#24)

* polish code, make the implementation more general

* cxx.png

* bump version to 0.4.1

* use plot interface for circuits

* nvm

* add example for ZXCalculus

* fix format

* fix fig

* add Multigraphs backend (#30)

* add Multigraphs

* up compat

* CompatHelper: add new compat entry for "GraphPlot" at version "0.4" (#31)

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* fix the plot for ZXGraph with phase gadgets (#27)

* bump version to 0.5.0

* works

* viz scale gate (unitary)

* fix phase

* fix tests

* update viznet

* CompatHelper: bump compat for "ZXCalculus" to "0.4" (#37)

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* new measure (#39)

* New multiqubit gate (#40)

* new measure

* new mutiple qubit gates

* multi-gate labeling

* allow changing line color

* allow changing line color (#42)

* Update Project.toml

* Initial commit

* Files generated by PkgTemplates

PkgTemplates version: 0.7.23

* update

* tests pass

* update tests

* CompatHelper: add new compat entry for OMEinsum at version 0.6, (keep existing compat)

* CompatHelper: add new compat entry for Yao at version 0.6, (keep existing compat)

* update docs

* Update README.md

* setup ci

* update project.toml

* Update README.md

* bump OMEinsumContractionOrders version

* Update Project.toml

* Add vega plot backend (#43)

* rework with Compose

* fix tests

* fix version

* add Vega backend

* add tests

* resolve version

* Revert "Add vega plot backend (#43)" (#44)

This reverts commit f04e3f4.

* fix tests, upgrade Graphs

* bump version, add codecov

* Update README.md

* polish viz circuit (#47)

* Update TagBot.yml

* boundary condition specification

* Update Project.toml

* Add instructions for changing plot attributes  (#49)

* Add attribute instruction plots

* Update README.md

* Delete attr_circuit_1.svg

* Update README.md

* Fixed a tiny one letter typo (#50)

Really sorry!!! 😬

* update yao

* update deps (#51)

* update circuit

* fix readme example

* bump version

* bump version

* Update README.md

* Update Project.toml (#52)

Just noticed that I wasn't able to upgrade to Yao 0.8 with YaoPlots. This should do it :D

* Update Project.toml

* Bump version of BitBasis in Project.toml (#53)

Sorry! Forgot about this one 🥲

* Update Project.toml

* update

* better visualization of labeled multi-qubit circuits (#55)

* update

* update

* update

* to basic style

* update

* update vizcircuit

* fix tests

* fix tests

* rm wg

* Update Project.toml

* fix multi-level

* Update CI.yml

* bump version

* [WIP] Switch to Luxor backend (#56)

* update luxor

* fix line break

* fix labelled example

* fix margin

* fix test

* ...

* more spacious

* ...

* seperate zx calculus

* upgrad OMEinsum

* update dpes

* fix #58 (#59)

* barrier for chain (#60)

* Update README.md

* add type TensorNetwork

* update README

* fix show

* cuda extension

* fix cuda ext

* Plot bloch sphere (#62)

* new bloch

* update README

* Update Project.toml

* Update Project.toml

* optimize projection gate

* update

* fix a dispatch

* impove test

* Update Project.toml

* Update README.md

* Update README.md

* Subtree merged in lib/YaoToEinsum

* complete YaoToEinsum merge

* complete YaoPlots merge

* clean up images

---------

Co-authored-by: Roger-luo <rogerluo.rl18@gmail.com>
Co-authored-by: Chen Zhao <zhaochen17@mails.ucas.ac.cn>
Co-authored-by: Chen Zhao <50411747+ChenZhao44@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: CompatHelper Julia <compathelper_noreply@julialang.org>
Co-authored-by: Chetan Vardhan <51269425+VarLad@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants