Coder Social home page Coder Social logo

densitymx_slow does not work about pygsti HOT 5 CLOSED

aristaeus avatar aristaeus commented on August 31, 2024
densitymx_slow does not work

from pygsti.

Comments (5)

aristaeus avatar aristaeus commented on August 31, 2024 1

Thanks! I suspected this was the change required, but I'm not familiar enough with the code to be confident.

from pygsti.

KangHaiYue avatar KangHaiYue commented on August 31, 2024

I had the same issue. This is the error message I got when trying to create a model:

File c:\Users\k0426\anaconda3\envs\working_env_new\Lib\site-packages\pygsti\models\modelconstruction.py:1847, in create_cloud_crosstalk_model(processor_spec, custom_gates, depolarization_strengths, stochastic_error_probs, lindblad_error_coeffs, depolarization_parameterization, stochastic_parameterization, lindblad_parameterization, evotype, simulator, independent_gates, independent_spam, errcomp_type, implicit_idle_mode, basis, verbosity)
1713 """
1714 Create a n-qudit "cloud-crosstalk" model.
1715
(...)
1840 CloudNoiseModel
1841 """
1843 modelnoise = _build_modelnoise_from_args(depolarization_strengths, stochastic_error_probs, lindblad_error_coeffs,
1844 depolarization_parameterization, stochastic_parameterization,
1845 lindblad_parameterization, allow_nonlocal=True)
-> 1847 return _create_cloud_crosstalk_model(processor_spec, modelnoise, custom_gates, evotype,
1848 simulator, independent_gates, independent_spam, errcomp_type,
1849 implicit_idle_mode, basis, verbosity)

File c:\Users\k0426\anaconda3\envs\working_env_new\Lib\site-packages\pygsti\models\modelconstruction.py:1876, in _create_cloud_crosstalk_model(processor_spec, modelnoise, custom_gates, evotype, simulator, independent_gates, independent_spam, errcomp_type, implicit_idle_mode, basis, verbosity)
1873 printer = _VerbosityPrinter.create_printer(verbosity)
1875 #Create static ideal gates without any noise (we use modelnoise further down)
-> 1876 gatedict = _setup_local_gates(processor_spec, evotype, None, custom_gates,
1877 ideal_gate_type=('static standard', 'static clifford', 'static unitary'),
1878 basis=basis)
1879 stencils = _collections.OrderedDict()
1881 # (Note: global idle is now processed with other processorspec gates)
1882
1883 # SPAM

File c:\Users\k0426\anaconda3\envs\working_env_new\Lib\site-packages\pygsti\models\modelconstruction.py:1475, in _setup_local_gates(processor_spec, evotype, modelnoise, custom_gates, ideal_gate_type, basis)
1473 ideal_gate = ideal_gates.get(name, None)
1474 if ideal_gate is None:
-> 1475 ideal_gate = _op.create_from_unitary_mx(U, ideal_gate_type, basis, stdname, evotype, state_space=None)
1476 ideal_gates[name] = ideal_gate
1477 noiseop = modelnoise.create_errormap(key, evotype, ideal_gate.state_space, target_labels=None)

File c:\Users\k0426\anaconda3\envs\working_env_new\Lib\site-packages\pygsti\modelmembers\operations_init_.py:59, in create_from_unitary_mx(unitary_mx, op_type, basis, stdname, evotype, state_space)
57 try:
58 if typ == 'static standard' and stdname is not None:
---> 59 op = StaticStandardOp(stdname, basis, evotype, state_space)
60 elif typ == 'static clifford':
61 op = StaticCliffordOp(U, None, basis, evotype, state_space)

File c:\Users\k0426\anaconda3\envs\working_env_new\Lib\site-packages\pygsti\modelmembers\operations\staticstdop.py:58, in StaticStandardOp.init(self, name, basis, evotype, state_space)
55 basis = _Basis.cast(basis, state_space.dim) # basis for Hilbert-Schmidt (superop) space
57 evotype = _Evotype.cast(evotype)
---> 58 rep = evotype.create_standard_rep(name, basis, state_space)
59 _LinearOperator.init(self, rep, evotype)

File c:\Users\k0426\anaconda3\envs\working_env_new\Lib\site-packages\pygsti\evotypes\evotype.py:136, in Evotype.create_standard_rep(self, standard_name, super_basis, state_space)
135 def create_standard_rep(self, standard_name, super_basis, state_space):
--> 136 return self.module.OpRepStandard(standard_name, super_basis, state_space)

File c:\Users\k0426\anaconda3\envs\working_env_new\Lib\site-packages\pygsti\evotypes\densitymx_slow\opreps.py:177, in OpRepStandard.init(self, name, basis, state_space)
174 state_space = _StateSpace.cast(state_space)
175 assert(superop.shape[0] == state_space.dim)
--> 177 super(OpRepStandard, self).init(superop, state_space)

TypeError: OpRepDenseSuperop.init() missing 1 required positional argument: 'state_space'

from pygsti.

sserita avatar sserita commented on August 31, 2024

Thanks for reporting this and for identifying a hole in our testing! This should be a quick fix, I'll have something on develop for you in the next day or so hopefully. We'll also add some tests in an environment without Cython to ensure we catch things like this in the future.

from pygsti.

sserita avatar sserita commented on August 31, 2024

I believe this is a one-line fix. It will be merged into develop shortly, and we are planning a hotfix release soon, but if you want to try the change locally and let me know if you run into other issues, you are certainly welcome to.

We go from:

super(OpRepStandard, self).__init__(superop, state_space)

to:

super(OpRepStandard, self).__init__(superop, basis, state_space)

from pygsti.

sserita avatar sserita commented on August 31, 2024

Closing as this was merged into develop with #439. The fixed-but-not-in-release tag will remain until the 0.9.12.3 release, which will include this fix.

from pygsti.

Related Issues (20)

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.