tests/testthat/test-payoffs_list.R

test_that("`payoffs_list()` works as expected", {
  I <- diag(2)
  H <- 1 / sqrt(2) * matrix(c(1, 1, 1, -1), 2, 2)
  Z <- diag(c(1, -1))
  gates <- list(I = I, H = H, Z = Z)
  alpha <- 0.3; beta <- 0.1; gamma <- 0.5; theta <- 0.2
  alpha2 <- 0.35; beta2 <- 0.15; gamma2 <- 0.6; theta2 <- 0.25
  payoffs <- payoffs_list(gates, alpha, beta, gamma, theta, alpha2, beta2, gamma2, theta2)
  expect_snapshot(payoffs)
})

Try the qvirus package in your browser

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

qvirus documentation built on June 8, 2025, 10:06 a.m.