Source code for pytket.extensions.braket.backends.config
# Copyright Quantinuum## Licensed under the Apache License, Version 2.0 (the "License");# you may not use this file except in compliance with the License.# You may obtain a copy of the License at## http://www.apache.org/licenses/LICENSE-2.0## Unless required by applicable law or agreed to in writing, software# distributed under the License is distributed on an "AS IS" BASIS,# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.# See the License for the specific language governing permissions and# limitations under the License.fromdataclassesimportdataclassfromtypingimportAny,ClassVarfrompytket.configimportPytketExtConfig
[docs]@dataclassclassBraketConfig(PytketExtConfig):"""Holds config parameters for pytket-braket."""ext_dict_key:ClassVar[str]="braket"s3_bucket:str|Nones3_folder:str|Nonedevice_type:str|Noneprovider:str|None
[docs]defset_braket_config(s3_bucket:str|None=None,s3_folder:str|None=None,device_type:str|None=None,provider:str|None=None,)->None:"""Set default values for any of s3_bucket, s3_folder, device_type or provider for AWS Braket. Can be overridden in backend construction."""config=BraketConfig.from_default_config_file()ifs3_bucketisnotNone:config.s3_bucket=s3_bucketifs3_folderisnotNone:config.s3_folder=s3_folderifdevice_typeisnotNone:config.device_type=device_typeifproviderisnotNone:config.provider=providerconfig.update_default_config_file()