Giter Site home page Giter Site logo

pyqlab's People

Contributors

blakejohnson avatar caryan avatar grahamrow avatar matthewware avatar rmcgurrin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pyqlab's Issues

U180 Pulse Not Defined

The SPAM sequence is trying to use a U180 pulse here which is not defined and fails this test.

Can the U180 be replaced with a Utheta?

Running test overwrites local config

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.

json 'label' and 'name' collision in SpectrumAnalyzer?

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

Update master branch

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?

Loading an invalid Sweeps.json causes a crash

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:

  1. Create a new default Sweep like below
    image

  2. Save the config

  3. 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

Passing validation when starting from scratch

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.

Removing a Measurement Filter that is used by a Correlator can crash ExpSettingsGUI.py

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

example setup:
image

example failure:
image

RFC: bring test_data into the repo

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?

MeasurementFactory

Produce quadrature or marker measurement channel based on a parameter.

Single waveform, single segment plotting

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.

Sometimes you can't remove items from Experiment Settings GUI

Steps to reproduce:

  1. Add 3 new instruments like below:
    image

  2. Select New2 and click "Remove"

  3. 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

Streaming timing estimate

QGL needs at least the same streaming timing estimate as PatternGen offered and hopefully better.

Unit tests failing

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:

FAIL: test_merge_channels (tests.test_Compiler.CompileUtils)

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)

Anaconda 2.2.0 h5py import error

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.

APS1 sequence length is not consistent compile to compile

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)

Automate unit tests

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

4-Sample Alignment

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.

Sequences failing when compiling for Tek5014 due to Wait not having attribute 'isTimeAmp'

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'

Can't run AWGs.py as a standalone script

Steps to reproduce:
python instruments/AWGs.py

Got the following error:
Traceback (most recent call last):
File "instruments/AWGs.py", line 90, in
from AWGViews import AWGView
ImportError: No module named AWGViews

Expected to see this:
image

Pull request with fix coming shortly

Have validator return a meaningful error

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.

UnicodeDecodeError

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)

Ipython notebook kernel restart required after working in ExpSettingsGUI?

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.

ExpSettingsGUI.py Feature Request: "Load Config" and "Save Config as" menu options

"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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.