algoutil

package
v1.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 17, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package algoutil provides shared helper functions for the algorithm subpackages.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BitstringToPhase

func BitstringToPhase(bs string, n int) float64

BitstringToPhase converts a binary fraction bitstring to a phase in [0, 1).

func IdentityMap

func IdentityMap(n int) map[int]int

IdentityMap returns a qubit mapping {0:0, 1:1, ..., n-1:n-1}.

func ReverseString

func ReverseString(s string) string

ReverseString reverses a string.

func TopKey

func TopKey(counts map[string]int, n int) string

TopKey returns the measurement bitstring with the highest count. If n > 0, bitstrings are truncated to the last n characters (corresponding to the lowest-indexed qubits in the phase register).

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL