importpathlibfromqibolab._core.componentsimportAcquisitionChannel,DcChannel,IqChannelfromqibolab._core.instruments.dummyimportDummyInstrument,DummyLocalOscillatorfromqibolab._core.parametersimportHardwarefromqibolab._core.platformimportPlatformfromqibolab._core.qubitsimportQubitFOLDER=pathlib.Path(__file__).parentdefcreate_dummy_hardware()->Hardware:"""Create dummy hardware configuration based on the dummy instrument."""qubits={}channels={}# attach the channelspump_name="twpa_pump"forqinrange(5):drive12=f"{q}/drive12"qubits[q]=qubit=Qubit.default(q,drive_extra={(1,2):drive12})channels|={qubit.probe:IqChannel(mixer=None,lo=None),qubit.acquisition:AcquisitionChannel(twpa_pump=pump_name,probe=qubit.probe),qubit.drive:IqChannel(mixer=None,lo=None),drive12:IqChannel(mixer=None,lo=None),qubit.flux:DcChannel(),}couplers={}forcin(0,1,3,4):couplers[c]=coupler=Qubit(flux=f"coupler_{c}/flux")channels|={coupler.flux:DcChannel()}# register the instrumentsinstruments={"dummy":DummyInstrument(address="0.0.0.0",channels=channels),pump_name:DummyLocalOscillator(address="0.0.0.0"),}returnHardware(instruments=instruments,qubits=qubits,couplers=couplers)
[docs]defcreate_dummy()->Platform:"""Create a dummy platform using the dummy instrument."""hardware=create_dummy_hardware()returnPlatform.load(path=FOLDER,**vars(hardware))