QuantumSavory / QuantumClifford.jl

Clifford circuits, graph states, and other quantum Stabilizer formalism tools.
MIT License
120 stars 47 forks source link

improvements to `GeneralizedStabilizer` API #260

Open Krastanov opened 7 months ago

Krastanov commented 7 months ago

There are a few interfaces not yet supported for GeneralizedStabilizer but which are easy to add. Here are operations which we can and can not do -- the goal is to have all of them implemented.

Krastanov commented 7 months ago

@hongyehu pinging just for reference as this is related to #259

Fe-r-oz commented 4 months ago

For documentation of Generalized Stabilizer, the paper by ted yoder can be helpful. I will be to work on this documentation as well.

''" The generalized stabilizer representation of an arbitrary state τ is a two-tuple (χ, B(S, D)). Here χ is a density matrix and B(S, D) = B(T ) is the basis in which χ is expressed. A generalized stabilizer (χ, B(T )), in some sense, separates the “classical” part of the quantum state from the quantum. The quasi-classical tableau T updates through Clifford gates and measurements, while the the χ-matrix is updated by non-Clifford operations.""

Is implementation inspired from this paper (A generalization of the stabilizer formalism for simulating arbitrary quantum circuits) while building generalized stabilizer ?

Non-clifford and non-stabilizer/non-stabilizerness mean the same thing right?

hongyehu commented 4 months ago

Hi Feroz,  Yes, it is largely inspired by Ted’s paper.Hong-Ye Hu, Ph.D.Department of Physics,Harvard University, Cambridge, MAOn Jun 21, 2024, at 9:55 AM, Feroz @.***> wrote: For documentation of Generalized Stabilizer, the paper by ted yoder can be helpful. I will be to work on this documentation as well. ''" The generalized stabilizer representation of an arbitrary state τ is a two-tuple (χ, B(S, D)). Here χ is a density matrix and B(S, D) = B(T ) is the basis in which χ is expressed. A generalized stabilizer (χ, B(T )), in some sense, separates the “classical” part of the quantum state from the quantum. The quasi-classical tableau T updates through Clifford gates and measurements, while the the χ-matrix is updated by non-Clifford operations."" Is implementation inspired from this paper (A generalization of the stabilizer formalism for simulating arbitrary quantum circuits) while building generalized stabilizer ? Non-clifford and non-stabilizer/non-stabilizerness mean the same thing right?

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you were mentioned.Message ID: @.***>

Fe-r-oz commented 3 months ago

@Krastanov, Would it be better to implement these tasks as separate PRs as that would make review easier? Completed sm⊗sm, should I submit a PR about this second task for review? I would value your input before proceeding.

julia> sm1 = GeneralizedStabilizer(S"X")
A mixture ∑ ϕᵢⱼ Pᵢ ρ Pⱼ† where ρ is
𝒟ℯ𝓈𝓉𝒶𝒷
+ Z
𝒮𝓉𝒶𝒷
+ X
with ϕᵢⱼ | Pᵢ | Pⱼ:
 1.0+0.0im | + _ | + _

julia> sm2 = GeneralizedStabilizer(S"-Z")
A mixture ∑ ϕᵢⱼ Pᵢ ρ Pⱼ† where ρ is
𝒟ℯ𝓈𝓉𝒶𝒷
+ X
𝒮𝓉𝒶𝒷
- Z
with ϕᵢⱼ | Pᵢ | Pⱼ:
 1.0+0.0im | + _ | + _

julia> sm1 ⊗ sm2
A mixture ∑ ϕᵢⱼ Pᵢ ρ Pⱼ† where ρ is
𝒟ℯ𝓈𝓉𝒶𝒷
+ Z_
+ _X
𝒮𝓉𝒶𝒷
+ X_
- _Z
with ϕᵢⱼ | Pᵢ | Pⱼ:
 1.0+0.0im | + __ | + __

julia> sm1 ⊗ sm2 ⊗ sm1
A mixture ∑ ϕᵢⱼ Pᵢ ρ Pⱼ† where ρ is
𝒟ℯ𝓈𝓉𝒶𝒷
+ Z__
+ _X_
+ __Z
𝒮𝓉𝒶𝒷━
+ X__
- _Z_
+ __X
with ϕᵢⱼ | Pᵢ | Pⱼ:
 1.0+0.0im | + ___ | + ___

P.S: some time later: After spending some time on this, 5/8 of these tasks are completed. It appears that one PR on these 5 tasks will be fine. I will rewire the current open noncliff pr to address these tasks first and focus on latter part later. Sorry for the ping!

Fe-r-oz commented 3 months ago

This interface can also be added as we can do this operation as well!

julia> sm = GeneralizedStabilizer(S"-X")
A mixture ∑ ϕᵢⱼ Pᵢ ρ Pⱼ† where ρ is
𝒟ℯ𝓈𝓉𝒶𝒷
+ Z
𝒮𝓉𝒶𝒷
- X
with ϕᵢⱼ | Pᵢ | Pⱼ:
 1.0+0.0im | + _ | + _

julia> P"-Y" * sm
A mixture ∑ ϕᵢⱼ Pᵢ ρ Pⱼ† where ρ is
𝒟ℯ𝓈𝓉𝒶𝒷
- Z
𝒮𝓉𝒶𝒷
+ X
with ϕᵢⱼ | Pᵢ | Pⱼ:
 1.0+0.0im | + _ | + _
Fe-r-oz commented 2 months ago

Inner product between generalized stabilizers (Section V of Ted's paper):

Fe-r-oz commented 3 weeks ago

Since pauligroup method is now defined which corresponds to the G(U), Theorem 16 provide an algorithm for StabilizerUnion of two Generalized Stabilizers.

Based on the algorithm and available methods (rowdecompose, pauligroup), the simplified version is as follows:

  1. Generator Decomposition

    • For each generator $s'_i$ in $S'$:
      • Decompose $s'_i$ in terms of $U$ using the rowdecompose.
  2. Decomposition Contents

    • If the decomposition of $s'_i$ contains only marked items:
      • Check if either $s'_i$ or $-s'_i$ is in $G(U)$, using the pauligroup:
      • If $-s'_i$ $\in$ $G(U)$:
        • Report that $T$ and $T'$ represent orthogonal states (since $G(U)$ contains $-I$).
      • Otherwise, $s'_i$ is in $G(U)$ and no further action is needed.
    • If the decomposition of $s'_i$ contains unmarked generators:
      • Replace one of these unmarked generators, say $\delta_k$, from the destabilizer of $U$ with $s'_i$.
      • Mark $s'_i$ as part of the stabilizer union.
      • Preserve the commutation algebra of the tableau $U$ to enable further decompositions:
      • Multiply any other generators from $U$ that anticommute with $s'_i$ by $\sigma_k$, the stabilizer generator from $U$ that is conjugate to $\delta_k$.
      • Note: No generator of $S'$ can anticommute with these marked destabilizers, as they themselves are members of $S'$.
  3. Repeat

    • Repeat this procedure for all generators $s'_i$ of $S'$.

Hopefully, the following organizes the above details with less specificity:

graph TD
    A[Start] --> B[Initialize tableau U to T]
    B --> C[Mark all stabilizer generators from S]

    C --> D[Generator Decomposition]
    D -->|For each generator sᵢ in S′| E[Decompose sᵢ in terms of U using rowdecompose]

    E --> F[Decomposition Contents]
    F -->|If decomposition of sᵢ contains only marked items| G[Check if either sᵢ or -sᵢ is in G of U using pauligroup]

    G -->|If -sᵢ is in G of U| H[Report that T and T prime represent orthogonal states]
    G -->|Otherwise| I[sᵢ is in G of U, no further action needed]

    F -->|If decomposition of sᵢ contains unmarked generators| J[Replace unmarked generator δₖ from destabilizer of U with sᵢ]
    J --> K[Mark sᵢ as part of stabilizer union]
    K --> L[Preserve commutation algebra of tableau U]
    L --> M[Multiply other generators from U that anticommute with sᵢ by σₖ]

    F --> N[Repeat for all generators sᵢ of S′]