bbn-q / pyqlab Goto Github PK
View Code? Open in Web Editor NEWA python library for instrument control and superconducting QIP experiments.
License: Apache License 2.0
A python library for instrument control and superconducting QIP experiments.
License: Apache License 2.0
Our notebook checking function in_pynb() doesn't work anymore.
If you download the test data and run tests locally, test_json.py clears your local json config files. I don't know if there's a right way to handle this which makes local testing easy and also doesn't break the Travis build.
Creating a new SpectrumAnalyzer object creates a 'label' field in Instruments.json. It seems like the enaml code is looking for a 'name' field. startup.py fails if you replace 'label' with 'name' in the json. 'deviceName' field also fails on startup
Gives us pretty printing which will be useful for debugging.
It's been over a year since we merged changes on develop into master. I know a lot is changing at the moment, but should we update master at some point soon?
The default values used when creating a new sweeps config json file can casue a divide by zero condition that crashes ExpSettingsGUI.py.
Steps to reproduce:
Save the config
Restart the GUI
You will get the following error:
....
File "/Users/rmcgurrin/anaconda/lib/python2.7/json/decoder.py", line 366, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/Users/rmcgurrin/anaconda/lib/python2.7/json/decoder.py", line 382, in raw_decode
obj, end = self.scan_once(s, idx)
File "/Users/rmcgurrin/sandbox/q/PyQlab/JSONHelpers.py", line 53, in dict_to_obj
inst = getattr(sys.modules[moduleName], className)(**jsonDict)
File "/Users/rmcgurrin/sandbox/q/PyQlab/Sweeps.py", line 49, in _set_step
self.numPoints = int((self.stop - self.start)/floatbits.prevfloat(step)) + 1
ValueError: cannot convert float NaN to integer
Expected Behavior:
You should get a validation error
Post merge of the explinter branch, I cannot seem to pass validation when starting from scratch with no instruments and no channels. The issue seems to be related to the physical channel -> AWG mapping, because after creating an AWG (e.g. and APS1) and then populating some physical channels, when I choose the APS1 as the AWG and then highlight another channel and return, the choice of AWG seems to vanish.
On an new machine, the Apply button is removing the last few lines of ChannelParams.json.
Steps to reproduce:
-Create 2 Kernel Integration Filters New1 and New2
-Create a Correlator New3, and choose New1 and New2 as Filter1 and Filter2 ( see example below)
-'Remove' New1 and select New3 ( example failure is shown below)
-The GUI crashes
Expected Behavior:
-GUI should not crash
-Filter1 Selection for the Correlator should be blank
Currently updating the unit testing golden sequences is messy and it's a few extra hidden steps for users to get the test_data to run on any changes they make before pushing. The compressed test data is only 88kB (and only 51kB if we switch to bzip2) and I'd be okay to bring it into the repo for now.
@bcdonovan and @blakejohnson any thoughts?
plot_pulse_files has a firstSeqNum with a default argument of -1. Should all sequence-length = 1 experiments be plotted with
plot_pulse_files(fileNames, firstSeqNum=0)
? -MW
Produce quadrature or marker measurement channel based on a parameter.
plot_pulse_files() throws 'list index out of range' for sequences with one waveform and one segment (cavity spectroscopy for example).
foo = [[MEAS(q1)]]
fooNames = compile_to_hardware(foo, 'junk/junk')
plot_pulse_files(fooNames)
fails.
Steps to reproduce:
Select New2 and click "Remove"
click "Remove" again to remove New3
New3 is not removed and the following error is printed on the console:
...
File "/Users/rmcgurrin/sandbox/q/PyQlab/DictManagerView.enaml", line 48, in
clicked :: dictManager.remove_item(itemList.selected_item)
File "/Users/rmcgurrin/sandbox/q/PyQlab/DictManager.py", line 34, in remove_item
self.itemDict.pop(itemLabel)
KeyError: u'New2'
Expected Behavior:
New3 should be removed
Reported by @dieris
repeat and qrepeat should be unified into a single repeat command which dispatches on input type (or perhaps length)
QGL needs at least the same streaming timing estimate as PatternGen offered and hopefully better.
Affects at least APS1
The a3f96c2 introduced a failure in the unit tests: looks like it has to do with the assert that was introduced.
Here is the FAIL message:
Traceback (most recent call last):
File "/Users/rmcgurrin/sandbox/q/PyQlab/tests/test_Compiler.py", line 98, in test_merge_channels
chLL = Compiler.merge_channels(ll, [q1, q2])
File "/Users/rmcgurrin/sandbox/q/PyQlab/QGL/Compiler.py", line 87, in merge_channels
assert np.count_nonzero([e.amp * e.channel.frequency for e in entries]) == 1, "Unable to handle merging more than one non-zero entry with non-zero frequency."
AssertionError: Unable to handle merging more than one non-zero entry with non-zero frequency.
Ran 91 tests in 60.777s
FAILED (failures=1, expected failures=28)
While attempting to follow the example notebook I received the following error from the startup.py script:
Traceback (most recent call last):
File "startup.py", line 2, in <module>
from Libraries import instrumentLib, channelLib
File "C:\Projects\Q\src\PyQLab\Libraries.py", line 7, in <module>
from QGL.Channels import ChannelLibrary
File "C:\Projects\Q\src\PyQLab\QGL\__init__.py", line 1, in <module>
from Channels import QubitFactory, MeasFactory, Qubit
File "C:\Projects\Q\src\PyQLab\QGL\Channels.py", line 25, in <module>
import Compiler
File "C:\Projects\Q\src\PyQLab\QGL\Compiler.py", line 35, in <module>
from APSPattern import write_APS_file
File "C:\Projects\Q\src\PyQLab\QGL\APSPattern.py", line 19, in <module>
import h5py
File "C:\Apps\Anaconda\lib\site-packages\h5py\__init__.py", line 13, in <module>
from h5py import _conv
File "h5py\h5r.pxd", line 21, in init h5py._conv (D:\Build\h5py\h5py-2.4.x\h5py\_conv.c:6809)
File "h5py\_objects.pxd", line 12, in init h5py.h5r (D:\Build\h5py\h5py-2.4.x\h5py\h5r.c:2824)
File "h5py\_objects.pyx", line 1, in init h5py._objects (D:\Build\h5py\h5py-2.4.x\h5py\_objects.c:6927)
ImportError: DLL load failed: The specified procedure could not be found.
Adding
import h5py
as the first line of the startup.py script eliminates the error.
Need to consolidate adjacent TAZ entries.
From this travis build.
Compiling the same sequence independently multiple times results in different sequence lengths. Sequence lengths often differ by 8 bytes.
See the following tests:
test_AllXY (tests.test_Sequences.TestAPS1)
test_Decoupling_CPMG (tests.test_Sequences.TestAPS1)
test_Rabi_RabiAmp_TwoQubits (tests.test_Sequences.TestAPS1)
test_Rabi_RabiWidth (tests.test_Sequences.TestAPS1)
test_T1T2_InversionRecovery (tests.test_Sequences.TestAPS1)
test_T1T2_Ramsey (tests.test_Sequences.TestAPS1)
Anaconda 2.2.0 does not appear to ship with atom or enaml. I had to run:
conda install atom
conda install enaml
In particular, instrument names cannot have hyphens, e.g. APS-1
should be disallowed.
The user should be able to generate square pulses from the marker channels at will, not just special cases like digitizerTrig.
Compiling a pulse with
RabiWidth(q1, 1e-9*np.linspace(0, 1e3, 101), showPlot=True)
Leads to a red L2 on the APS producing the measurement pulse.
Expand upon current unit tests.
Goal is to be able to apply continuous integration to PyQlab
Factor out show from existing unit tests so that they may be automated
Currently it is up to the user to align on a 4 sample boundary or pay the penalty when APSPattern.py rounds the count down to the nearest 4 sample boundary. Most of the time this just gives some inter-sequence jitter. However in a longer sequence with a repeated block, e.g. a CPMG sequence, if the pulse spacing is not aligned then the truncations accumulate leading to sequence timing that is much further off.
It should be possible to more elegantly handle this and to never be more than 4 samples away from the desired sequence.
CNOT(q1,q2) needs to look up the appropriate channel.
From this travis build.
The AllXY, EchoCRLen, CPMG sequences (and others) are failing when built for a Tek5014.
The AllXY test results in the following error (the EchoCRLen is similar see travis):
======================================================================
ERROR: test_AllXY (tests.test_Sequences.TestTek5014)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/travis/build/BBN-Q/PyQLab/tests/test_Sequences.py", line 146, in test_AllXY
AllXY(self.q1)
File "/home/travis/build/BBN-Q/PyQLab/QGL/BasicSequences/AllXY.py", line 13, in AllXY
filenames = compile_to_hardware(seqs, 'AllXY/AllXY')
File "/home/travis/build/BBN-Q/PyQLab/QGL/Compiler.py", line 243, in compile_to_hardware
write_sequence_file(instrumentLib[awgName], data, fullFileName)
File "/home/travis/build/BBN-Q/PyQLab/QGL/mm.py", line 32, in __call__
return function(*args)
File "/home/travis/build/BBN-Q/PyQLab/QGL/Compiler.py", line 419, in write_sequence_file
write_Tek_file(data, filename, 1)
File "/home/travis/build/BBN-Q/PyQLab/QGL/TekPattern.py", line 214, in write_Tek_file
wfs[0], wfs[1] = merge_waveform(ct, awgData['ch12'], awgData['ch1m1'], awgData['ch1m2'], awgData['ch2m1'], awgData['ch2m2'])
File "/home/travis/build/BBN-Q/PyQLab/QGL/TekPattern.py", line 78, in merge_waveform
if not entry.isTimeAmp:
AttributeError: 'Wait' object has no attribute 'isTimeAmp'
Adding channels.
AWG's need to be handled.
Issue on both APS1 and APS2
It seems like we could have ExpSettingsVal return what the error was either in the popup box or an ipython shell. Is this something people would be interested in? I could start working on it.
Need to be able to call MEAS(q1).
Easy to get it confused.
Error when trying to print a sequence in an IPython notebook (before compiling to hardware).
Using Python 2.7 in windows 7 64 bit.
Example of error:
C:\Users\qlab\Anaconda\lib\json\encoder.pyc in encode(self, o)
208 if not isinstance(chunks, (list, tuple)):
209 chunks = list(chunks)
--> 210 return ''.join(chunks)
211
212 def iterencode(self, o, _one_shot=False):
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 9: ordinal not in range(128)
Triggers for digitizer and slave devices for now.
In particular, this line needs to be in a try-catch block.
This may be an issue specifically with notebook, however, when working with ipyhton notebooks, modifying settings via the ExpSettingsGUI and writing them out does not result in them being read in the next time run startup is invoked on an open notebook. The only way to read in the new changes is to restart the kernel in the notebook with which you are interacting.
This may be known or expected behavior, but I thought it was of interest to report here for the sake of lessons learned.
"Save Config as" use case:
-User chooses the "Save Config as" option from the "File" menu
-A file browser opens to allow the user to choose a directory ( or create a new one if wanted)
-The config json files are saved to the chosen directory
"Load Config" use case:
-User chooses the "Load Config" option from the "File" menu
-A file browser opens and the user chooses a directory
-The config files in that directory are copied to the default config file locations as specified in config.json
-ExpSettingsGUI.py restarts itself
Automatic gating for quadrature channels.
Need to figure out a better way to break the dependency cycle.
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.