Documentation ¶
Index ¶
- func Diffusion(qreg *QReg, target int)
- func DiffusionRange(qreg *QReg, target_range_start int, target_range_end int)
- func DiffusionReg(qreg *QReg)
- func Hadamard(qreg *QReg, target int)
- func HadamardRange(qreg *QReg, target_range_start int, target_range_end int)
- func HadamardReg(qreg *QReg)
- type Gate
- func NewArrayGate(arr []complex128) *Gate
- func NewClassicalGate(f func(x int) int, bits int) *Gate
- func NewDiffusionGate(bits int) *Gate
- func NewFuncGate(f func(row int, col int) complex128, bits int) *Gate
- func NewFuncGateNoCheck(f func(row int, col int) complex128, bits int) *Gate
- func NewHadamardGate(bits int) *Gate
- func NewRealArrayGate(arr []float64) *Gate
- type QReg
- func (qreg *QReg) BMeasure(index int) int
- func (qreg *QReg) BMeasurePreserve(index int) int
- func (qreg *QReg) BProb(index int, value int) float64
- func (qreg *QReg) BSet(index int, value int)
- func (qreg *QReg) Copy() *QReg
- func (qreg *QReg) Measure() int
- func (qreg *QReg) MeasurePreserve() int
- func (qreg *QReg) Print()
- func (qreg *QReg) PrintNonZero()
- func (qreg *QReg) PrintState(index int)
- func (qreg *QReg) PrintStateln(index int)
- func (qreg *QReg) Set(values ...int)
- func (qreg *QReg) StateProb(state int) float64
- func (qreg *QReg) Width() int
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DiffusionRange ¶
func DiffusionReg ¶
func DiffusionReg(qreg *QReg)
func HadamardRange ¶
func HadamardReg ¶
func HadamardReg(qreg *QReg)
Types ¶
type Gate ¶
type Gate struct {
// contains filtered or unexported fields
}
func NewArrayGate ¶
func NewArrayGate(arr []complex128) *Gate
func NewDiffusionGate ¶
func NewFuncGate ¶
func NewFuncGate(f func(row int, col int) complex128, bits int) *Gate
func NewFuncGateNoCheck ¶
func NewFuncGateNoCheck(f func(row int, col int) complex128, bits int) *Gate
func NewHadamardGate ¶
func NewRealArrayGate ¶
func (*Gate) Apply ¶
Apply an arbitrary matrix to a quantum register len(matrix) == 4 ** len(targets)
func (*Gate) ApplyRange ¶
type QReg ¶
type QReg struct {
// contains filtered or unexported fields
}
Represents a quantum register
func (*QReg) BMeasurePreserve ¶
Measure a bit without collapsing its quantum state
func (*QReg) MeasurePreserve ¶
Measure a register without collapsing its quantum state
func (*QReg) PrintNonZero ¶
func (qreg *QReg) PrintNonZero()
func (*QReg) PrintState ¶
func (*QReg) PrintStateln ¶
func (*QReg) Set ¶
Set the QReg to a state in the standard basis. If no value is given, default to the all zero state. If one value is given, interpret it as the integer representation of a basis state. If a series of binary values are given, interpret them as the binary representation of a basis state.
Click to show internal directories.
Click to hide internal directories.