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

add quantum array and operations support #5

Merged
merged 3 commits into from
Feb 6, 2025

Conversation

ImHangLi
Copy link
Collaborator

@ImHangLi ImHangLi commented Feb 5, 2025

Quantum Types and Operations Implementation

This PR implements core quantum computing functionality for the Quave framework:

Changes

  • Added quantum array implementation for multi-qubit systems
  • Enhanced measurement operations with computational and arbitrary basis support
  • Updated partial density operator handling
  • Refined quantum type system and unitary operations

…s - Maintains original amplitude when projecting onto basis state - Properly implements quantum projection operator
…mplitudes - Maintains original amplitude when projecting onto basis state - Properly implements quantum projection operator"

This reverts commit fbdbd28.
@ImHangLi ImHangLi self-assigned this Feb 5, 2025
Copy link
Owner

@alexjgreig alexjgreig left a comment

Choose a reason for hiding this comment

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

This looks good. After implementing control sequence structures (while, if etc.), rotation gates and the connection between qArray and partial density operator, we should be able to represent any arbitrary quantum program with this syntax. Do you agree?

ℝ × (Fin 2 → ℂ) :=
let prob := measure_probability state basis_state
let post_state := project_state state basis_state
(prob, post_state)
Copy link
Owner

Choose a reason for hiding this comment

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

Is the probability and post state pair returned so that it can be used for the classical and quantum state pair of the state or the program?

Fields:
* `state` - The quantum state vector in the 2^n dimensional Hilbert space
* `is_normalized` - Proof that the state is normalized (sum of probabilities = 1) -/
structure QArray (n : Nat) where
Copy link
Owner

Choose a reason for hiding this comment

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

Is this going to be changed to n classical terms which are the index of each qubit? I.e when there are two classical terms, it represents a grid of qubits. Can revisit this definition after defining the other syntax and semantics first.

else -- control = 1
if target = (1 - j_target) then 1 else 0
else 0

Copy link
Owner

Choose a reason for hiding this comment

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

These gates look good! Need to also implement the parametric rotation gates.

@alexjgreig alexjgreig merged commit 557eac1 into alexjgreig:main Feb 6, 2025
1 check passed
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