service

package
v0.0.0-...-d4941c9 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2019 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Index

func Index(input []*Qubit) []int

func NewQgRCPServer

func NewQgRCPServer(set Set) q.QsimServer

Types

type ApplyRequest

type ApplyRequest struct {
	Matrix matrix.Matrix
	Input  []*Qubit
}

type ControlledRequest

type ControlledRequest struct {
	Control []*Qubit
	Target  *Qubit
	K       int
}

type Q

type Q struct {
	// contains filtered or unexported fields
}

func New

func New() *Q

func NewQsim

func NewQsim() *Q

func (*Q) Apply

func (q *Q) Apply(mat matrix.Matrix, input ...*Qubit) *Q

func (*Q) CNOT

func (q *Q) CNOT(control *Qubit, target *Qubit) *Q

func (*Q) CR

func (q *Q) CR(control *Qubit, target *Qubit, k int) *Q

func (*Q) CZ

func (q *Q) CZ(control *Qubit, target *Qubit) *Q

func (*Q) Clone

func (q *Q) Clone() *Q

func (*Q) ConditionX

func (q *Q) ConditionX(condition bool, input ...*Qubit) *Q

func (*Q) ConditionZ

func (q *Q) ConditionZ(condition bool, input ...*Qubit) *Q

func (*Q) ControlledNot

func (q *Q) ControlledNot(control []*Qubit, target *Qubit) *Q

func (*Q) ControlledR

func (q *Q) ControlledR(control []*Qubit, target *Qubit, k int) *Q

func (*Q) ControlledZ

func (q *Q) ControlledZ(control []*Qubit, target *Qubit) *Q

func (*Q) Estimate

func (q *Q) Estimate(input *Qubit, loop ...int) *qubit.Qubit

func (*Q) H

func (q *Q) H(input ...*Qubit) *Q

func (*Q) InverseQFT

func (q *Q) InverseQFT() *Q

func (*Q) Measure

func (q *Q) Measure(input ...*Qubit) *qubit.Qubit

func (*Q) New

func (q *Q) New(z ...complex128) *Qubit

func (*Q) NumberOfBit

func (q *Q) NumberOfBit() int

func (*Q) One

func (q *Q) One() *Qubit

func (*Q) Probability

func (q *Q) Probability() []float64

func (*Q) QFT

func (q *Q) QFT() *Q

func (*Q) S

func (q *Q) S(input ...*Qubit) *Q

func (*Q) State

func (q *Q) State() []float64

func (*Q) Swap

func (q *Q) Swap(q0, q1 *Qubit) *Q

func (*Q) T

func (q *Q) T(input ...*Qubit) *Q

func (*Q) X

func (q *Q) X(input ...*Qubit) *Q

func (*Q) Y

func (q *Q) Y(input ...*Qubit) *Q

func (*Q) Z

func (q *Q) Z(input ...*Qubit) *Q

func (*Q) Zero

func (q *Q) Zero() *Qubit

type QRequest

type QRequest struct {
	Qubits []*Qubit
}

type QResponse

type QResponse struct {
	Qr  *Q
	Err error `json:"error,omitempty"`
}

type QgRPC

type QgRPC struct {
	HandlerH             grpctransport.Handler
	HandlerX             grpctransport.Handler
	HandlerY             grpctransport.Handler
	HandlerZ             grpctransport.Handler
	HandlerS             grpctransport.Handler
	HandlerT             grpctransport.Handler
	HandlerApply         grpctransport.Handler
	HandlerControlledR   grpctransport.Handler
	HandlerControlledZ   grpctransport.Handler
	HandlerControlledNOT grpctransport.Handler
	HandlerQFT           grpctransport.Handler
	HandlerInverseQFT    grpctransport.Handler
}

func (*QgRPC) Apply

func (s *QgRPC) Apply(ctx context.Context, req *q.ApplyRequest) (*q.QResponse, error)

func (*QgRPC) ControlledNOT

func (s *QgRPC) ControlledNOT(ctx context.Context, req *q.ControlledRequest) (*q.QResponse, error)

func (*QgRPC) ControlledR

func (s *QgRPC) ControlledR(ctx context.Context, req *q.ControlledRequest) (*q.QResponse, error)

func (*QgRPC) ControlledZ

func (s *QgRPC) ControlledZ(ctx context.Context, req *q.ControlledRequest) (*q.QResponse, error)

func (*QgRPC) H

func (s *QgRPC) H(ctx context.Context, req *q.QRequest) (*q.QResponse, error)

func (*QgRPC) InverseQFT

func (s *QgRPC) InverseQFT(ctx context.Context, req *q.None) (*q.QResponse, error)

func (*QgRPC) QFT

func (s *QgRPC) QFT(ctx context.Context, req *q.None) (*q.QResponse, error)

func (*QgRPC) S

func (s *QgRPC) S(ctx context.Context, req *q.QRequest) (*q.QResponse, error)

func (*QgRPC) T

func (s *QgRPC) T(ctx context.Context, req *q.QRequest) (*q.QResponse, error)

func (*QgRPC) X

func (s *QgRPC) X(ctx context.Context, req *q.QRequest) (*q.QResponse, error)

func (*QgRPC) Y

func (s *QgRPC) Y(ctx context.Context, req *q.QRequest) (*q.QResponse, error)

func (*QgRPC) Z

func (s *QgRPC) Z(ctx context.Context, req *q.QRequest) (*q.QResponse, error)

type Qsim

type Qsim interface {
	H(intput ...*Qubit) *Q
	X(intput ...*Qubit) *Q
	Y(intput ...*Qubit) *Q
	Z(intput ...*Qubit) *Q
	S(intput ...*Qubit) *Q
	T(intput ...*Qubit) *Q
	Apply(mat matrix.Matrix, intput ...*Qubit) *Q
	ControlledR(control []*Qubit, target *Qubit, k int) *Q
	ControlledZ(control []*Qubit, target *Qubit) *Q
	ControlledNOT(control []*Qubit, target *Qubit) *Q
	QFT() *Q
	InverseQFT() *Q
}

func NewQgRPCClient

func NewQgRPCClient(conn *grpc.ClientConn) Qsim

type Qubit

type Qubit struct {
	Index int
}

type Set

type Set struct {
	EpH             endpoint.Endpoint
	EpX             endpoint.Endpoint
	EpY             endpoint.Endpoint
	EpZ             endpoint.Endpoint
	EpS             endpoint.Endpoint
	EpT             endpoint.Endpoint
	EpApply         endpoint.Endpoint
	EpControlledR   endpoint.Endpoint
	EpControlledZ   endpoint.Endpoint
	EpControlledNOT endpoint.Endpoint
	EpQFT           endpoint.Endpoint
	EpInverseQFT    endpoint.Endpoint
}

func MakeEndpoints

func MakeEndpoints(qs Qsim) Set

func (Set) Apply

func (s Set) Apply(m matrix.Matrix, input ...*Qubit) *Q

func (Set) ControlledNOT

func (s Set) ControlledNOT(control []*Qubit, target *Qubit) *Q

func (Set) ControlledR

func (s Set) ControlledR(control []*Qubit, target *Qubit, k int) *Q

func (Set) ControlledZ

func (s Set) ControlledZ(control []*Qubit, target *Qubit) *Q

func (Set) H

func (s Set) H(input ...*Qubit) *Q

func (Set) InverseQFT

func (s Set) InverseQFT() *Q

func (Set) QFT

func (s Set) QFT() *Q

func (Set) S

func (s Set) S(input ...*Qubit) *Q

func (Set) T

func (s Set) T(input ...*Qubit) *Q

func (Set) X

func (s Set) X(input ...*Qubit) *Q

func (Set) Y

func (s Set) Y(input ...*Qubit) *Q

func (Set) Z

func (s Set) Z(input ...*Qubit) *Q

Jump to

Keyboard shortcuts

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