Liking cljdoc? Tell your friends :D

org.soulspace.qclojure.domain.channel

Quantum channel domain layer providing pure quantum mechanical channel operations.

This namespace contains the core quantum channel functionality separated from implementation details. It focuses on the mathematical representation and application of quantum channels through Kraus operators.

Quantum channels represent the most general form of quantum operations, describing how quantum states evolve under the influence of noise, decoherence, and other physical processes. Every quantum channel can be represented using the Kraus representation: Ε(ρ) = Σᵢ KᵢρKᵢ†

Key concepts implemented:

  • Kraus operator generation for standard noise models
  • Quantum channel application to quantum states
  • Decoherence parameter calculations
  • Matrix operations for quantum channel mathematics
Quantum channel domain layer providing pure quantum mechanical channel operations.

This namespace contains the core quantum channel functionality separated from
implementation details. It focuses on the mathematical representation and 
application of quantum channels through Kraus operators.

Quantum channels represent the most general form of quantum operations,
describing how quantum states evolve under the influence of noise, decoherence,
and other physical processes. Every quantum channel can be represented using
the Kraus representation: Ε(ρ) = Σᵢ KᵢρKᵢ†

Key concepts implemented:
- Kraus operator generation for standard noise models
- Quantum channel application to quantum states
- Decoherence parameter calculations
- Matrix operations for quantum channel mathematics
raw docstring

amplitude-damping-kraus-operatorsclj

(amplitude-damping-kraus-operators gamma)

Generate Kraus operators for amplitude damping (T1 decay).

Models energy dissipation where |1⟩ decays to |0⟩. Kraus operators: K₀ = [[1, 0], [0, √(1-γ)]], K₁ = [[0, √γ], [0, 0]]

Parameters:

  • gamma: Damping parameter (0 <= gamma <= 1)

Returns: Vector of Kraus operators using fastmath complex numbers

Generate Kraus operators for amplitude damping (T1 decay).

Models energy dissipation where |1⟩ decays to |0⟩.
Kraus operators: K₀ = [[1, 0], [0, √(1-γ)]], K₁ = [[0, √γ], [0, 0]]

Parameters:
- gamma: Damping parameter (0 <= gamma <= 1)

Returns: Vector of Kraus operators using fastmath complex numbers
sourceraw docstring

apply-matrix-to-amplitudeclj

(apply-matrix-to-amplitude amplitude-pair matrix)

Apply a 2x2 matrix to a single amplitude pair in a quantum state.

Performs proper complex matrix-vector multiplication: [new-a0] = [m00 m01] [a0] [new-a1] [m10 m11] [a1]

Parameters:

  • amplitude-pair: [a0 a1] where each is a fastmath Vec2 complex number
  • matrix: 2x2 matrix [[m00 m01] [m10 m11]] with fastmath complex elements

Returns: [new-a0 new-a1] as fastmath complex numbers

Apply a 2x2 matrix to a single amplitude pair in a quantum state.

Performs proper complex matrix-vector multiplication:
[new-a0] = [m00 m01] [a0]
[new-a1]   [m10 m11] [a1]

Parameters:
- amplitude-pair: [a0 a1] where each is a fastmath Vec2 complex number
- matrix: 2x2 matrix [[m00 m01] [m10 m11]] with fastmath complex elements

Returns: [new-a0 new-a1] as fastmath complex numbers
sourceraw docstring

apply-quantum-channelclj

(apply-quantum-channel state kraus-operators qubit-index)

Apply a complete quantum channel defined by multiple Kraus operators.

For pure state simulators, implements quantum channels by randomly selecting one Kraus operator to apply based on the probabilities encoded in the Kraus operator coefficients. This provides correct noise simulation.

Parameters:

  • state: Input quantum state
  • kraus-operators: Vector of Kraus operators with matrices and coefficients
  • qubit-index: Target qubit

Returns: Output quantum state after channel application

Apply a complete quantum channel defined by multiple Kraus operators.

For pure state simulators, implements quantum channels by randomly selecting
one Kraus operator to apply based on the probabilities encoded in the Kraus
operator coefficients. This provides correct noise simulation.

Parameters:
- state: Input quantum state
- kraus-operators: Vector of Kraus operators with matrices and coefficients
- qubit-index: Target qubit

Returns: Output quantum state after channel application
sourceraw docstring

apply-single-qubit-kraus-operatorclj

(apply-single-qubit-kraus-operator state kraus-op qubit-index)

Apply a single Kraus operator to a specific qubit in a multi-qubit state.

This implements the proper quantum mechanics for Kraus operator application: |ψ'⟩ = K|ψ⟩ / ||K|ψ⟩||

The Kraus operator matrix should already include any coefficients.

Parameters:

  • state: Quantum state
  • kraus-op: Kraus operator {:matrix matrix}
  • qubit-index: Target qubit (0-indexed)

Returns: New quantum state after applying Kraus operator and normalizing

Apply a single Kraus operator to a specific qubit in a multi-qubit state.

This implements the proper quantum mechanics for Kraus operator application:
|ψ'⟩ = K|ψ⟩ / ||K|ψ⟩||

The Kraus operator matrix should already include any coefficients.

Parameters:
- state: Quantum state
- kraus-op: Kraus operator {:matrix matrix}
- qubit-index: Target qubit (0-indexed)

Returns: New quantum state after applying Kraus operator and normalizing
sourceraw docstring

calculate-decoherence-paramsclj

(calculate-decoherence-params t1 t2 gate-time)

Calculate decoherence parameters from T1, T2 times and gate duration.

Parameters:

  • t1: T1 relaxation time (microseconds)
  • t2: T2 dephasing time (microseconds)
  • gate-time: Gate operation time (nanoseconds)

Returns: {:gamma-1 gamma-2} decoherence parameters

Calculate decoherence parameters from T1, T2 times and gate duration.

Parameters:
- t1: T1 relaxation time (microseconds)
- t2: T2 dephasing time (microseconds) 
- gate-time: Gate operation time (nanoseconds)

Returns: {:gamma-1 gamma-2} decoherence parameters
sourceraw docstring

channel-fidelityclj

(channel-fidelity input-state output-state)

Calculate the fidelity between input and output states of a channel.

Fidelity measures how well a quantum channel preserves quantum information. F(ρ, σ) = Tr(√(√ρ σ √ρ))²

For pure states: F(|ψ⟩, |φ⟩) = |⟨ψ|φ⟩|²

Parameters:

  • input-state: Input quantum state
  • output-state: Output quantum state after channel application

Returns: Fidelity value between 0 and 1

Calculate the fidelity between input and output states of a channel.

Fidelity measures how well a quantum channel preserves quantum information.
F(ρ, σ) = Tr(√(√ρ σ √ρ))²

For pure states: F(|ψ⟩, |φ⟩) = |⟨ψ|φ⟩|²

Parameters:
- input-state: Input quantum state
- output-state: Output quantum state after channel application

Returns: Fidelity value between 0 and 1
sourceraw docstring

coherent-error-kraus-operatorclj

(coherent-error-kraus-operator angle axis)

Generate Kraus operator for coherent (systematic) errors.

Parameters:

  • angle: Rotation angle in radians
  • axis: Rotation axis (:x, :y, or :z)

Returns: Single Kraus operator for coherent rotation

Generate Kraus operator for coherent (systematic) errors.

Parameters:
- angle: Rotation angle in radians
- axis: Rotation axis (:x, :y, or :z)

Returns: Single Kraus operator for coherent rotation
sourceraw docstring

compose-channelsclj

(compose-channels channel-1 channel-2)

Compose two quantum channels sequentially.

The composition of two channels Ε₁ and Ε₂ is (Ε₂ ∘ Ε₁)(ρ) = Ε₂(Ε₁(ρ))

Parameters:

  • channel-1: First quantum channel (applied first)
  • channel-2: Second quantum channel (applied second)

Returns: Function that applies both channels sequentially

Compose two quantum channels sequentially.

The composition of two channels Ε₁ and Ε₂ is (Ε₂ ∘ Ε₁)(ρ) = Ε₂(Ε₁(ρ))

Parameters:
- channel-1: First quantum channel (applied first)
- channel-2: Second quantum channel (applied second)

Returns: Function that applies both channels sequentially
sourceraw docstring

depolarizing-kraus-operatorsclj

(depolarizing-kraus-operators p)

Generate Kraus operators for depolarizing noise channel.

The depolarizing channel applies each Pauli operator with probability p/4, and leaves the state unchanged with probability 1-3p/4.

For proper normalization: Σᵢ Kᵢ† Kᵢ = I

Parameters:

  • p: Total error probability (0 <= p <= 3/4 for physical channel)

Returns: Vector of Kraus operators with coefficients applied to matrices

Generate Kraus operators for depolarizing noise channel.

The depolarizing channel applies each Pauli operator with probability p/4,
and leaves the state unchanged with probability 1-3p/4.

For proper normalization: Σᵢ Kᵢ† Kᵢ = I

Parameters:
- p: Total error probability (0 <= p <= 3/4 for physical channel)

Returns: Vector of Kraus operators with coefficients applied to matrices
sourceraw docstring

phase-damping-kraus-operatorsclj

(phase-damping-kraus-operators gamma)

Generate Kraus operators for phase damping (T2 dephasing).

Models random phase flips without energy loss. Kraus operators: K₀ = [[1, 0], [0, √(1-γ)]], K₁ = [[0, 0], [0, √γ]]

Parameters:

  • gamma: Dephasing parameter (0 <= gamma <= 1)

Returns: Vector of Kraus operators using fastmath complex numbers

Generate Kraus operators for phase damping (T2 dephasing).

Models random phase flips without energy loss.
Kraus operators: K₀ = [[1, 0], [0, √(1-γ)]], K₁ = [[0, 0], [0, √γ]]

Parameters:
- gamma: Dephasing parameter (0 <= gamma <= 1)

Returns: Vector of Kraus operators using fastmath complex numbers
sourceraw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close