File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed
Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -26,6 +26,21 @@ class PyQrackOptions(typing.TypedDict):
2626 isOpenCL : bool
2727
2828
29+ def _validate_pyqrack_options (options : PyQrackOptions ) -> None :
30+ if options ["isBinaryDecisionTree" ] and options ["isStabilizerHybrid" ]:
31+ raise ValueError (
32+ "Cannot use both isBinaryDecisionTree and isStabilizerHybrid at the same time."
33+ )
34+ elif options ["isTensorNetwork" ] and options ["isBinaryDecisionTree" ]:
35+ raise ValueError (
36+ "Cannot use both isTensorNetwork and isBinaryDecisionTree at the same time."
37+ )
38+ elif options ["isTensorNetwork" ] and options ["isStabilizerHybrid" ]:
39+ raise ValueError (
40+ "Cannot use both isTensorNetwork and isStabilizerHybrid at the same time."
41+ )
42+
43+
2944def _default_pyqrack_args () -> PyQrackOptions :
3045 return PyQrackOptions (
3146 qubitCount = - 1 ,
@@ -45,6 +60,9 @@ class MemoryABC(abc.ABC):
4560 pyqrack_options : PyQrackOptions = field (default_factory = _default_pyqrack_args )
4661 sim_reg : "QrackSimulator" = field (init = False )
4762
63+ def __post_init__ (self ):
64+ _validate_pyqrack_options (self .pyqrack_options )
65+
4866 @abc .abstractmethod
4967 def allocate (self , n_qubits : int ) -> tuple [int , ...]:
5068 """Allocate `n_qubits` qubits and return their ids."""
You can’t perform that action at this time.
0 commit comments