Example #1
0
 def test_vacuum_state(self):
     """Test the vacuum state is correct."""
     self.logTestName()
     wires = 3
     means, cov = vacuum_state(wires, hbar=hbar)
     self.assertAllAlmostEqual(means, np.zeros([2*wires]), delta=self.tol)
     self.assertAllAlmostEqual(cov, np.identity(2*wires)*hbar/2, delta=self.tol)
 def test_vacuum_state(self, tol):
     """Test the vacuum state is correct."""
     wires = 3
     means, cov = vacuum_state(wires, hbar=hbar)
     assert means == pytest.approx(np.zeros([2*wires]), abs=tol)
     assert cov == pytest.approx(np.identity(2*wires)*hbar/2, abs=tol)