qt3uw / qcsapphire Goto Github PK
View Code? Open in Web Editor NEWPython Software tool to control the Quantum Composer Sapphire pulser
License: BSD 3-Clause "New" or "Revised" License
Python Software tool to control the Quantum Composer Sapphire pulser
License: BSD 3-Clause "New" or "Revised" License
Channel 0 is really the system channel, so the function should immediately raise an exception with a readable message (and not wait for the device to return an error code)
From @palnitishh
hi, I am trying to communicate to the COM4 in my case using
pulser = qcsapphire.Pulser('COM4')
but end up with error
IndexError Traceback (most recent call last)
~\AppData\Local\Temp\ipykernel_8180\1879743324.py in
----> 1 pulser = qcsapphire.Pulser('COM4')
~\AppData\Roaming\Python\Python39\site-packages\qcsapphire\pulser.py in init(self, port, timeout)
88 self.open()
89 self._command_history = collections.deque(maxlen=1000)
---> 90 self._read_hardware_versions()
91
92 ## PRIVATE
~\AppData\Roaming\Python\Python39\site-packages\qcsapphire\pulser.py in _read_hardware_versions(self)
175
176 def _read_hardware_versions(self):
--> 177 res_str = self.query('*IDN?')
178 _, model_number, serial_number, firm_fpga = res_str.split(',')
179 self.model_number = model_number
~\AppData\Roaming\Python\Python39\site-packages\qcsapphire\pulser.py in query(self, data)
223 return_val = self._readlines()
224 else:
--> 225 return_val = self._readline()
226
227 return return_val
~\AppData\Roaming\Python\Python39\site-packages\qcsapphire\pulser.py in _readline(self)
162 '''
163 rdata = self._inst.readline()
--> 164 return self._check_error(rdata.decode('utf-8').strip())
165
166 def _readlines(self):
~\AppData\Roaming\Python\Python39\site-packages\qcsapphire\pulser.py in _check_error(self, string)
128 except Exception as e:
129 self._readlines() #flush out the read return on error to be ready for next query
--> 130 raise e
131
132 return string
~\AppData\Roaming\Python\Python39\site-packages\qcsapphire\pulser.py in _check_error(self, string)
107
108 try:
--> 109 if string[0] == '?':
110 if string[1] == '1':
111 raise Exception(f'Incorrect prefix, i.e. no colon or * to start command. Last write command == {self.last_write_command}')
IndexError: string index out of range
what do you think, am I mising some prequisites or something else is wrong?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.