Coverage for /home/runner/work/tket/tket/pytket/pytket/__init__.py: 82%

15 statements  

« prev     ^ index     » next       coverage.py v7.8.0, created at 2025-05-09 15:08 +0000

1# Copyright Quantinuum 

2# 

3# Licensed under the Apache License, Version 2.0 (the "License"); 

4# you may not use this file except in compliance with the License. 

5# You may obtain a copy of the License at 

6# 

7# http://www.apache.org/licenses/LICENSE-2.0 

8# 

9# Unless required by applicable law or agreed to in writing, software 

10# distributed under the License is distributed on an "AS IS" BASIS, 

11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 

12# See the License for the specific language governing permissions and 

13# limitations under the License. 

14 

15"""Python Interface to tket""" 

16 

17import pytket.architecture # noqa: I001 

18from pytket.circuit import ( 

19 Circuit, 

20 OpType, 

21) 

22import pytket.mapping 

23import pytket.placement 

24import pytket.transform 

25from pytket._version import __version__ 

26from pytket.config import PytketConfig, get_config_file_path 

27from pytket.unit_id import ( 

28 Bit, 

29 Qubit, 

30) 

31 

32# Create pytket config file if it does not exist: 

33pytket_config_file = get_config_file_path() 

34if not pytket_config_file.exists(): 34 ↛ 35line 34 didn't jump to line 35 because the condition on line 34 was never true

35 config = PytketConfig.default() 

36 config.write_file(pytket_config_file) 

37 

38__path__ = __import__("pkgutil").extend_path(__path__, __name__) 

39 

40"""Flag indicating 64-bit support. 

41 

42If True, classical transforms and predicates, and QASM registers, with up to 64 

43bits are supported.""" 

44bit_width_64 = True