diff --git a/packages/simulator/test/simulator.test.ts b/packages/simulator/test/simulator.test.ts index a8a35c40d..bd650519c 100644 --- a/packages/simulator/test/simulator.test.ts +++ b/packages/simulator/test/simulator.test.ts @@ -573,4 +573,16 @@ describe('Simulator', () => { expect(equate(simulator.measuredBits, {0: 1, 1: 1})).toBeTruthy() }) }) + + describe('cswap', () => { + test('|011>.cswap(0, 1, 2) should be |101>', () => { + const simulator = new Simulator('011') + expect(equate(simulator.cswap(0, 1, 2).state, new StateVector('101'))).toBeTruthy() + }) + + test('|011>.cswap(2, 0, 1) should be |011>', () => { + const simulator = new Simulator('011') + expect(equate(simulator.cswap(2, 0, 1).state, new StateVector('011'))).toBeTruthy() + }) + }) }) diff --git a/packages/simulator/test/simulator.ts b/packages/simulator/test/simulator.ts deleted file mode 100644 index acd11671e..000000000 --- a/packages/simulator/test/simulator.ts +++ /dev/null @@ -1,16 +0,0 @@ -import {Matrix, Simulator, StateVector} from '../src' -import {Complex} from '@qni/common' - -QUnit.module('Simulator', () => { - QUnit.module('.cswap', () => { - QUnit.test('|011>.cswap(0, 1, 2) should be |101>', assert => { - const simulator = new Simulator('011') - assert.approximatelyEquates(simulator.cswap(0, 1, 2).state, new StateVector('101')) - }) - - QUnit.test('|011>.cswap(2, 0, 1) should be |011>', assert => { - const simulator = new Simulator('011') - assert.approximatelyEquates(simulator.cswap(2, 0, 1).state, new StateVector('011')) - }) - }) -})