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

move some utilities in YaoExtensions to Yao.EasyBuild submodule. #315

Merged
merged 9 commits into from
Dec 16, 2021

Conversation

GiggleLiu
Copy link
Member

@GiggleLiu GiggleLiu commented Dec 9, 2021

Some blocks and circuit builders.

List of blocks

  • ReflectGate
  • Bag
  • EchoBlock
  • FSimGate
  • ConditionBlock
  • PauliString
  • RotBasis
  • MathGate
  • Mod
  • QFTBlock

List of shortcuts

  • cphase and CPhaseGate
  • singlet_block
  • ISWAP
  • SqrtX
  • SqrtY
  • SqrtW
  • eyeblock
  • fsim_gate

List of circuits

  • general_U4
  • phase_estimation_circuit
  • qft_circuit
  • rand_google53
  • hadamard_test_circuit
  • swap_test_circuit
  • rand_supremacy2d
  • variational_circuit

List of hamiltonians

  • heisenberg
  • transverse_ising

NOTE 1: they are not exported to the global scope, one has to type

using Yao.EasyBuild

to access these features in Yao's submodule.

NOTE 2: the reason why some blocks are not added

  • Mod: too specialized for Shor's algorithm, better place it in QuAlgorithmZoo.
  • QFTBlock: requires FFTW, I do not want to add one more dependency for it.
  • MathGate: this block is hard to use correctly.

It does not mean other blocks are useful, will consider removing them in the future, they are in the deleting list. When a block can be replace by a combination of other blocks, I prefer not creating a new type except there is a practical using case.

@codecov
Copy link

codecov bot commented Dec 9, 2021

Codecov Report

Merging #315 (e3fc22b) into master (f217ac7) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #315   +/-   ##
=======================================
  Coverage   80.02%   80.02%           
=======================================
  Files          68       68           
  Lines        3524     3524           
=======================================
  Hits         2820     2820           
  Misses        704      704           

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 f217ac7...e3fc22b. Read the comment docs.

Copy link
Member

@Roger-luo Roger-luo left a comment

Choose a reason for hiding this comment

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

other parts LGTM

A general single qubits gate: ``e^(iϕ)R_z(θ_3)R_y(θ_2)R_z(θ_1)``.
Leave `ϕ` as `nothing` to fix the global phase.
"""
function general_U2(θ1, θ2, θ3; ϕ=nothing)
Copy link
Member

Choose a reason for hiding this comment

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

should this just be a block? this is also needed to map to openQASM etc.

Copy link
Member Author

Choose a reason for hiding this comment

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

It sounds good, but let us do it in another PR. Let us convert your comment to an issue?

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.

2 participants