Skip to content

Bloch sphere plots from NamedTrajectory #19

@andgoldschmidt

Description

@andgoldschmidt

Background

In quantum mechanics, the Bloch sphere is a geometrical representation of the state space of a two-level quantum system. It allows us to visualize quantum states as points on or inside a unit sphere.

The Bloch sphere representation is an isomorphism between a quantum state (up to a global phase) and a point on the unit sphere. Pure states all live on the surface of the Bloch sphere. Density matrices also have a Bloch sphere representation, potentially going inside the unit sphere.

Implementation

Makie recipes

First, the goal is to write a Makie.@recipe (guide for Makie recipes) called plot_bloch that plots a vector trajectory on a Bloch sphere. The inputs should be a triplet of real numbers for the Bloch vector and use Makie’s 3D plotting utilities.

Isomorphisms

This PR will require a few helper functions in PiccoloQuantumObjects.jl; these changes should live in isomorphisms.jl:

  • ket_to_bloch(ψ::AbstractVector{ℂ}) where ℂ <: Number: Converts a qubit ket to Bloch vector coordinates.
  • density_to_bloch(ψ::AbstractMatrix{ℂ}) where ℂ <: Number: Converts a qubit density matrix to Bloch vector coordinates.
  • bloch_to_ket(v::AbstractVector{ℝ}) where ℝ <: Real: Converts Bloch vector coordinates back into a ket (up to global phase).
  • bloch_to_density(v::AbstractVector{ℝ}) where ℝ <: Real: Converts a qubit ket (state vector) to Bloch vector coordinates.

NamedTrajectories

A version of plot_bloch should be written which dispatches on a NamedTrajectory. This can be accomplished using the isomorphism to convert data that lives in a trajectory into the Bloch vector for the plot.

Steps to complete

  • Makie recipe
  • Isomorphisms
  • Makie recipe for NamedTrajectory

Nice to haves

  • It would be fun to animate the evolution over time, and draw something fun on the Bloch sphere. This can be added to our docs page!

Metadata

Metadata

Assignees

Labels

unitary-hackIssue is bountied for unitary hack

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions