Skip to content

Commit

Permalink
updating docs
Browse files Browse the repository at this point in the history
  • Loading branch information
bdoolittle committed Aug 22, 2020
1 parent 7153dc1 commit 0363df8
Show file tree
Hide file tree
Showing 10 changed files with 67 additions and 21 deletions.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2020 Brian Doolittle <briand4@illinois.edu> and contributors
Copyright (c) 2020 Brian Doolittle <briand.d.doolittle@gmail.com> and contributors

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
27 changes: 27 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,30 @@
[![Build Status](https://travis-ci.com/ChitambarLab/QBase.jl.svg?branch=master)](https://travis-ci.com/ChitambarLab/QBase.jl)
[![Coverage](https://codecov.io/gh/ChitambarLab/QBase.jl/branch/master/graph/badge.svg)](https://codecov.io/gh/chitambarlab/QBase.jl)
[![Coverage Status](https://coveralls.io/repos/github/ChitambarLab/QBase.jl/badge.svg?branch=master)](https://coveralls.io/github/ChitambarLab/QBase.jl?branch=master)

## Features:
1. Types and constructors for representing quantum states and operators.
2. Methods for evolving quantum systems and performing quantum measurements.
3. Methods for computing information-theoretic quantities.
4. Mathematics utilities to support quantum calculations.

## Installation

```
julia> using Pkg; Pkg.add("QBase")
```

## Citing

Please review [`CITATION.bib`](https://github.com/ChitambarLab/QBase.jl/blob/master/CITATION.bib)
for citation of this work.

## Licensing

QBase.jl is released under the MIT License.

## Acknowledgements

Development of QBase.jl was made possible by the advisory of Dr. Eric Chitambar
and general support from the Physics Department at the University of Illinois
Urbana-Champaign. Funding was provided by NSF Award 1914440.
14 changes: 9 additions & 5 deletions docs/src/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,21 @@ CurrentModule = QBase
3. Methods for computing information-theoretic quantities.
4. Mathematics utilities to support quantum calculations.

## Citing

Please review [`CITATION.bib`](https://github.com/ChitambarLab/QBase.jl/blob/master/CITATION.bib)
for citation of this work.

## Licensing

QBase.jl is released under the MIT License.

## Acknowledgements

Development of QBase.jl was made possible by the advisory of Dr. Eric Chitambar
and general support from the Physics Department at the University of Illinois
Urbana-Champaign. Funding was provided by NSF Award 1914440.

## Citing

Please review [`CITATION.bib`](https://github.com/ChitambarLab/QBase.jl/blob/master/CITATION.bib)
for citation of this work.

## Contents

```@contents
Expand Down
6 changes: 3 additions & 3 deletions docs/src/submodules/States.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ with vectors (Bra-Ket Representation) or matrices (Density Matrix Representation

## Bra-Ket Representation

A quantum state may be represented by a vector on a complex-valued Hilbert space.
In Bra-Ket notation, a quantum state is represented by a ket denoted ``|\psi\rangle``.
A ket can simply be understood as a column vector. Each ket has an associated dual
A quantum state is represented by a vector on a complex-valued Hilbert space.
In Bra-Ket notation, a quantum state denoted ``|\psi\rangle`` is referred to as
a ket and is simply understood as a column vector. Each ket has an associated dual
vector known as a bra. A bra is may be represented by a row vector and can be
constructed from a ket via Hermitian adjoint, ``\langle\psi| = (|\psi\rangle)^{\dagger}``.

Expand Down
2 changes: 1 addition & 1 deletion docs/src/user_guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@
1. Add the QBase.jl Package:

```julia
julia> using Pkg; Pkg.add(PackageSpec(url="https://github.com/ChitambarLab/QBase.jl"))
julia> using Pkg; Pkg.add("QBase")
```
17 changes: 14 additions & 3 deletions src/Information.jl
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,10 @@ conditional_entropy(
end

"""
mutual_information( priors :: QMath.Marginals, conditionals :: QMath.Conditionals ) :: Float64
mutual_information(
priors :: QMath.Marginals,
conditionals :: QMath.Conditionals
) :: Float64
The entropy of the overlap between p(x) and p(y). The information shared from y to x.
"""
Expand All @@ -197,7 +200,11 @@ mutual_information(
end

"""
success_probability(priors::QMath.Marginals, ρ_states::Vector{<:States.AbstractDensityMatrix}, Π::Observables.AbstractPOVM) :: Float64
success_probability(
priors::QMath.Marginals,
ρ_states::Vector{<:States.AbstractDensityMatrix},
Π::Observables.AbstractPOVM
) :: Float64
The probability of correctly distinguishing quantum states with the specifed POVM.
"""
Expand All @@ -217,7 +224,11 @@ success_probability(
end

"""
error_probability(priors::QMath.Marginals, ρ_states::Vector{<:States.AbstractDensityMatrix}, Π::Observables.AbstractPOVM) :: Float64
error_probability(
priors::QMath.Marginals,
ρ_states::Vector{<:States.AbstractDensityMatrix},
Π::Observables.AbstractPOVM
) :: Float64
The probability of incorrectly distinguishing quantum states with the specifed POVM.
"""
Expand Down
2 changes: 1 addition & 1 deletion src/Observables.jl
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ Base.setindex!(P::AbstractPOVM, v, id::Int) = (P.Π[id...] = v)
Returns `true` if `Π` is a POVM. The following constraints must be satisfied:
* Each POVM element is hermitian
* Each POVM element positive semi-definite
* The POVM is complete: `sum(Π) == identity matrix`
* The POVM is complete: `sum(Π) == I`
"""
is_povm::AbstractPOVM) :: Bool = true
function is_povm::Vector) :: Bool
Expand Down
1 change: 1 addition & 0 deletions src/QMath/probability.jl
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ p(1|1) & \dots & p(1|M) \\
\vdots & \ddots & \vdots \\
p(N|1) & \dots & p(N|M) \\
\end{bmatrix}
```
"""
struct Conditionals <: AbstractMatrix{Float64}
probabilities :: Matrix{Float64}
Expand Down
15 changes: 9 additions & 6 deletions src/States.jl
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ Base.:*(U::Unitaries.AbstractUnitary, ψ::AbstractKet) :: Ket = Ket(U.U*ψ.ψ)
Returns `true` if vector `ψ` is a valid ket representation of a quamtum state:
* `ψ` is a real or complex-valued vector.
* `ψ` is normalized with respect to the bra-ket inner prodcut (`ψ'ψ == 0`).
* `ψ` is normalized with respect to the bra-ket inner prodcut (`ψ' * ψ == 0`).
"""
function is_ket::Vector)::Bool
norm(ψ) 1.0
Expand All @@ -79,7 +79,7 @@ end
A ket representation of a 2-dimensional quantum state. When given invalid input,
the constructor, `QubitKet(ψ)`, throws:
* `DomainError` - If `ψ` is not normalized.
* `MethodError` - If `ψ` is not a column vector (`[a,b]` or `[a;b]`).
* `MethodError` - If `ψ` is not a column vector.
"""
struct QubitKet <: AbstractKet
ψ :: Ket
Expand Down Expand Up @@ -157,7 +157,7 @@ The method alternatively accepts a `Vector` input.
pure_state( ψ :: Vector ) :: Qubit
A `DomainError` is thrown if `ψ` is not a valid ket.`
A `DomainError` is thrown if `ψ` is not a valid ket.
"""
function pure_state::AbstractKet)::DensityMatrix
DensityMatrix*ψ')
Expand Down Expand Up @@ -235,7 +235,10 @@ function pure_qubit(ψ::Vector)::Qubit
end

"""
mixed_state( priors :: QMath.Marginals, ρ_states :: Vector{<:AbstractDensityMatrix} ) :: DensityMatrix
mixed_state(
priors :: QMath.Marginals,
ρ_states :: Vector{<:AbstractDensityMatrix}
) :: DensityMatrix
Constructs the statistical mixture (weighted average) of quantum states. The
method accepts states as type `DensityMatrix` or subbtypes `AbstractDensityMatrix`.
Expand Down Expand Up @@ -294,15 +297,15 @@ Returns the qubit trine states in density matrix form.
const trine_qubits = pure_qubit.(trine_qubit_kets)

"""
mirror_symmetric_qubits(θ) :: Vector{Qubit}
mirror_symmetric_qubits( θ :: Real ) :: Vector{Qubit}
Returns a set of 3 mirror symmetric qubit density matrices. The first
state is ``|0\\rangle\\langle 0|`` the other two are symmetric about the ``|0\\rangle`` axis.
Input:
* `θ ∈ [0,π/2]`: the hilbert space angle between ``|0\\rangle`` and ``|\\psi_{2/3}\\rangle``.
"""
function mirror_symmetric_qubits(θ)::Vector{Qubit}
function mirror_symmetric_qubits :: Real)::Vector{Qubit}
pure_qubit.(mirror_symmetric_qubit_kets(θ))
end

Expand Down
2 changes: 1 addition & 1 deletion src/Unitaries.jl
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ Base.setindex!(unitary::AbstractUnitary, v, id::Int) = (unitary.U[id...] = v)
Returns `true` if matrix `U` is unitary. The hermitian adjoint of a unitary matrix
is its inverse:
* `U'U == I` where `I` is the identity matrix.
* `U' * U == I` where `I` is the identity matrix.
A unitary matrix must be square. A `DomainError` is thrown if input `U` is not square.
"""
Expand Down

2 comments on commit 0363df8

@bdoolittle
Copy link
Member Author

Choose a reason for hiding this comment

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

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

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

Registration pull request created: JuliaRegistries/General/19994

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.1.0 -m "<description of version>" 0363df846b65e84ad45e30422598f8f7cf2e360a
git push origin v0.1.0

Please sign in to comment.