Documentation ¶
Index ¶
- Variables
- func Probabilities(stateVector map[string]complex128) map[string]float64
- func Symbofy(s complex128) string
- func SymbofyMap(s map[string]complex128) map[string]string
- type CCXGate
- type CCZGate
- type CNOTGate
- type CRxGate
- type CRyGate
- type CRzGate
- type CZGate
- type Circuit
- type CircuitGate
- type Gate
- type GateInterface
- func CCX() GateInterface
- func CCZ() GateInterface
- func CNOT() GateInterface
- func CRx(theta float64) GateInterface
- func CRy(theta float64) GateInterface
- func CRz(theta float64) GateInterface
- func CZ() GateInterface
- func Hadamard() GateInterface
- func Identity(dim int) GateInterface
- func PauliX() GateInterface
- func PauliY() GateInterface
- func PauliZ() GateInterface
- func Phase() GateInterface
- func Rx(theta float64) GateInterface
- func Ry(theta float64) GateInterface
- func Rz(theta float64) GateInterface
- func S() GateInterface
- func SWAP() GateInterface
- func T() GateInterface
- func Toffoli() GateInterface
- type HadamardGate
- type IdentityGate
- type Matrix
- type PauliXGate
- type PauliYGate
- type PauliZGate
- type PhaseGate
- type Result
- type RxGate
- type RyGate
- type RzGate
- type SGate
- type SWAPGate
- type TGate
- type ToffoliGate
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrUnknownGate = errors.New("unknown gate") ErrDuplicateWire = errors.New("duplicate wire") ErrInvalidWireFormat = errors.New("invalid wire format") ErrInvalidArgument = errors.New("invalid argument") ErrGateMatrixNotSquare = errors.New("gate matrix is not square") ErrInvalidWireCount = errors.New("invalid wire count") ErrInvalidBarrier = errors.New("invalid barrier") ErrTooManyGates = errors.New(fmt.Sprintf("too many gates, max: %d", maxGates)) ErrTooManyWires = errors.New(fmt.Sprintf("too many wires, max: %d", maxWires)) )
Functions ¶
func Probabilities ¶
func Probabilities(stateVector map[string]complex128) map[string]float64
func SymbofyMap ¶
func SymbofyMap(s map[string]complex128) map[string]string
map of complex128s to map of strings
Types ¶
type CCXGate ¶ added in v0.0.5
type CCXGate struct {
Gate
}
func (CCXGate) WiresNeeded ¶ added in v0.0.5
type CCZGate ¶ added in v0.0.5
type CCZGate struct {
Gate
}
func (CCZGate) WiresNeeded ¶ added in v0.0.5
type CRxGate ¶ added in v0.0.5
type CRxGate struct { Gate // contains filtered or unexported fields }
func (CRxGate) WiresNeeded ¶ added in v0.0.5
type CRyGate ¶ added in v0.0.5
type CRyGate struct { Gate // contains filtered or unexported fields }
func (CRyGate) WiresNeeded ¶ added in v0.0.5
type CRzGate ¶ added in v0.0.5
type CRzGate struct { Gate // contains filtered or unexported fields }
func (CRzGate) WiresNeeded ¶ added in v0.0.5
type CircuitGate ¶
type CircuitGate struct { Gate GateInterface Wires []int }
type GateInterface ¶
type GateInterface interface { WiresNeeded() int Name() string FullName() string Example() string Data() Matrix }
func CCX ¶ added in v0.0.5
func CCX() GateInterface
func CCZ ¶ added in v0.0.5
func CCZ() GateInterface
func CNOT ¶
func CNOT() GateInterface
func CRx ¶ added in v0.0.5
func CRx(theta float64) GateInterface
func CRy ¶ added in v0.0.5
func CRy(theta float64) GateInterface
func CRz ¶ added in v0.0.5
func CRz(theta float64) GateInterface
func CZ ¶
func CZ() GateInterface
func Hadamard ¶
func Hadamard() GateInterface
func Identity ¶
func Identity(dim int) GateInterface
func PauliX ¶
func PauliX() GateInterface
func PauliY ¶
func PauliY() GateInterface
func PauliZ ¶
func PauliZ() GateInterface
func Phase ¶
func Phase() GateInterface
func Rx ¶ added in v0.0.5
func Rx(theta float64) GateInterface
func Ry ¶ added in v0.0.5
func Ry(theta float64) GateInterface
func Rz ¶ added in v0.0.5
func Rz(theta float64) GateInterface
func S ¶
func S() GateInterface
func SWAP ¶
func SWAP() GateInterface
func T ¶
func T() GateInterface
func Toffoli ¶
func Toffoli() GateInterface
type HadamardGate ¶
type HadamardGate struct {
Gate
}
func (HadamardGate) Example ¶ added in v0.0.5
func (g HadamardGate) Example() string
func (HadamardGate) FullName ¶ added in v0.0.5
func (g HadamardGate) FullName() string
func (HadamardGate) WiresNeeded ¶
func (g HadamardGate) WiresNeeded() int
type IdentityGate ¶
type IdentityGate struct {
Gate
}
func (IdentityGate) Example ¶ added in v0.0.5
func (g IdentityGate) Example() string
func (IdentityGate) FullName ¶ added in v0.0.5
func (g IdentityGate) FullName() string
func (IdentityGate) WiresNeeded ¶
func (g IdentityGate) WiresNeeded() int
type Matrix ¶
type Matrix struct { Rows int Cols int Data [][]complex128 }
func (*Matrix) CanMultiply ¶
func (*Matrix) MustMultiply ¶
type PauliXGate ¶
type PauliXGate struct {
Gate
}
func (PauliXGate) Example ¶ added in v0.0.5
func (g PauliXGate) Example() string
func (PauliXGate) FullName ¶ added in v0.0.5
func (g PauliXGate) FullName() string
func (PauliXGate) WiresNeeded ¶
func (g PauliXGate) WiresNeeded() int
type PauliYGate ¶
type PauliYGate struct {
Gate
}
func (PauliYGate) Example ¶ added in v0.0.5
func (g PauliYGate) Example() string
func (PauliYGate) FullName ¶ added in v0.0.5
func (g PauliYGate) FullName() string
func (PauliYGate) WiresNeeded ¶
func (g PauliYGate) WiresNeeded() int
type PauliZGate ¶
type PauliZGate struct {
Gate
}
func (PauliZGate) Example ¶ added in v0.0.5
func (g PauliZGate) Example() string
func (PauliZGate) FullName ¶ added in v0.0.5
func (g PauliZGate) FullName() string
func (PauliZGate) WiresNeeded ¶
func (g PauliZGate) WiresNeeded() int
type RxGate ¶ added in v0.0.5
type RxGate struct { Gate // contains filtered or unexported fields }
func (RxGate) WiresNeeded ¶ added in v0.0.5
type RyGate ¶ added in v0.0.5
type RyGate struct { Gate // contains filtered or unexported fields }
func (RyGate) WiresNeeded ¶ added in v0.0.5
type RzGate ¶ added in v0.0.5
type RzGate struct { Gate // contains filtered or unexported fields }
func (RzGate) WiresNeeded ¶ added in v0.0.5
type ToffoliGate ¶
type ToffoliGate struct {
Gate
}
func (ToffoliGate) Example ¶ added in v0.0.5
func (g ToffoliGate) Example() string
func (ToffoliGate) FullName ¶ added in v0.0.5
func (g ToffoliGate) FullName() string
func (ToffoliGate) WiresNeeded ¶
func (g ToffoliGate) WiresNeeded() int
Click to show internal directories.
Click to hide internal directories.