-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from tjstavenger-pnnl/code-review
Code review
- Loading branch information
Showing
8 changed files
with
320 additions
and
162 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import c2qa | ||
import pytest | ||
import qiskit | ||
|
||
|
||
def test_no_registers(): | ||
with pytest.raises(ValueError): | ||
c2qa.CVCircuit() | ||
|
||
|
||
def test_only_quantumregister(): | ||
with pytest.raises(ValueError): | ||
qr = qiskit.QuantumRegister(1) | ||
c2qa.CVCircuit(qr) | ||
|
||
|
||
def test_only_qumoderegister(): | ||
c2qa.CVCircuit(c2qa.QumodeRegister(1, 1)) | ||
|
||
|
||
def test_multiple_qumoderegisters(): | ||
with pytest.warns(UserWarning): | ||
c2qa.CVCircuit(c2qa.QumodeRegister(1, 1), c2qa.QumodeRegister(1, 1)) | ||
|
||
|
||
def test_correct(): | ||
c2qa.CVCircuit(qiskit.QuantumRegister(1), c2qa.QumodeRegister(1, 1)) | ||
|
||
|
||
def test_with_classical(): | ||
c2qa.CVCircuit(qiskit.QuantumRegister(1), c2qa.QumodeRegister(1, 1), qiskit.ClassicalRegister(1)) |
Oops, something went wrong.