Liking cljdoc? Tell your friends :D

org.soulspace.qclojure.adapter.visualization.coordinates

Mathematical coordinate transformations for quantum visualization.

This namespace handles 3D to 2D projections for Bloch sphere visualization and other coordinate system transformations needed for quantum state graphics.

Mathematical coordinate transformations for quantum visualization.

This namespace handles 3D to 2D projections for Bloch sphere visualization
and other coordinate system transformations needed for quantum state graphics.
raw docstring

bloch-distanceclj

(bloch-distance coords1 coords2)

Calculate Euclidean distance between two points on Bloch sphere.

Parameters:

  • coords1, coords2: Coordinate maps with :cartesian {:x x :y y :z z}

Returns: Distance value between 0 and 2

Calculate Euclidean distance between two points on Bloch sphere.

Parameters:
- coords1, coords2: Coordinate maps with :cartesian {:x x :y y :z z}

Returns:
Distance value between 0 and 2
sourceraw docstring

find-closest-reference-stateclj

(find-closest-reference-state coords)

Find the reference state closest to given coordinates.

Parameters:

  • coords: Coordinate map with :cartesian {:x x :y y :z z}

Returns: Vector [state-label distance] of closest reference state

Find the reference state closest to given coordinates.

Parameters:
- coords: Coordinate map with :cartesian {:x x :y y :z z}

Returns:
Vector [state-label distance] of closest reference state
sourceraw docstring

generate-sphere-wireframeclj

(generate-sphere-wireframe n-circles n-meridians n-points)

Generate wireframe coordinates for a unit sphere.

Parameters:

  • n-circles: Number of latitude circles
  • n-meridians: Number of longitude meridians
  • n-points: Points per circle/meridian

Returns: Map with :circles and :meridians containing coordinate sequences

Generate wireframe coordinates for a unit sphere.

Parameters:
- n-circles: Number of latitude circles
- n-meridians: Number of longitude meridians  
- n-points: Points per circle/meridian

Returns:
Map with :circles and :meridians containing coordinate sequences
sourceraw docstring

isometric-projectionclj

(isometric-projection x3d y3d z3d center scale)

Apply isometric projection from 3D coordinates to 2D.

Parameters:

  • x3d, y3d, z3d: 3D coordinates
  • center: Center point for projection [cx cy]
  • scale: Scaling factor

Returns: Vector [x2d y2d] of projected 2D coordinates

Apply isometric projection from 3D coordinates to 2D.

Parameters:
- x3d, y3d, z3d: 3D coordinates
- center: Center point for projection [cx cy]
- scale: Scaling factor

Returns:
Vector [x2d y2d] of projected 2D coordinates
sourceraw docstring

orthographic-projectionclj

(orthographic-projection x3d _y3d z3d center scale)

Apply orthographic projection from 3D coordinates to 2D.

Parameters:

  • x3d, y3d, z3d: 3D coordinates
  • center: Center point for projection [cx cy]
  • scale: Scaling factor

Returns: Vector [x2d y2d] of projected 2D coordinates

Apply orthographic projection from 3D coordinates to 2D.

Parameters:
- x3d, y3d, z3d: 3D coordinates
- center: Center point for projection [cx cy]
- scale: Scaling factor

Returns:
Vector [x2d y2d] of projected 2D coordinates
sourceraw docstring

perspective-projectionclj

(perspective-projection x3d y3d z3d center scale distance)

Apply perspective projection from 3D coordinates to 2D.

Parameters:

  • x3d, y3d, z3d: 3D coordinates
  • center: Center point for projection [cx cy]
  • scale: Scaling factor
  • distance: Distance from viewer (affects perspective strength)

Returns: Vector [x2d y2d] of projected 2D coordinates

Apply perspective projection from 3D coordinates to 2D.

Parameters:
- x3d, y3d, z3d: 3D coordinates
- center: Center point for projection [cx cy]
- scale: Scaling factor
- distance: Distance from viewer (affects perspective strength)

Returns:
Vector [x2d y2d] of projected 2D coordinates
sourceraw docstring

quantum-state-to-bloch-coordinatesclj

(quantum-state-to-bloch-coordinates state)

Convert single-qubit quantum state to Bloch sphere coordinates.

For a quantum state |ψ⟩ = α|0⟩ + β|1⟩, calculates the spherical coordinates (θ, φ) and Cartesian coordinates (x, y, z) on the Bloch sphere.

Parameters:

  • state: Single-qubit quantum state with :state-vector containing [α β]

Returns: Map with :spherical {:theta θ :phi φ} and :cartesian {:x x :y y :z z}

Convert single-qubit quantum state to Bloch sphere coordinates.

For a quantum state |ψ⟩ = α|0⟩ + β|1⟩, calculates the spherical coordinates
(θ, φ) and Cartesian coordinates (x, y, z) on the Bloch sphere.

Parameters:
- state: Single-qubit quantum state with :state-vector containing [α β]

Returns:
Map with :spherical {:theta θ :phi φ} and :cartesian {:x x :y y :z z}
sourceraw docstring

reference-state-coordinatesclj

(reference-state-coordinates)

Get Bloch sphere coordinates for common reference states.

Returns: Map from state labels to {:cartesian {:x x :y y :z z}} coordinates

Get Bloch sphere coordinates for common reference states.

Returns:
Map from state labels to {:cartesian {:x x :y y :z z}} coordinates
sourceraw docstring

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

× close