R/CX.R

Defines functions CX

Documented in CX

#' @export
CX <- function(...){
	CX <- matrix(c(1,0,0,0, 0,1,0,0, 0,0,0,1, 0,0,1,0),nrow=4,ncol=4)
	ket <- list(...)
	if(length(ket) == 0){
		CX
	} else{
		CX %*% ket[[1]]
	}	
}

Try the QuantumOps package in your browser

Any scripts or data that you put into this service are public.

QuantumOps documentation built on Feb. 3, 2020, 5:07 p.m.