-
Notifications
You must be signed in to change notification settings - Fork 108
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
before embedding check that the destination basis matches the operator basis #246
Conversation
I changed the syntax as discussed in #240. I'm sure things could be more elegant, but at least everything seems to work properly like this. Let me know if you have any suggestions before I merge this. |
Codecov Report
@@ Coverage Diff @@
## master #246 +/- ##
==========================================
+ Coverage 93.4% 96.65% +3.24%
==========================================
Files 36 36
Lines 2973 2897 -76
==========================================
+ Hits 2777 2800 +23
+ Misses 196 97 -99
Continue to review full report at Codecov.
|
Codecov Report
@@ Coverage Diff @@
## master #246 +/- ##
==========================================
- Coverage 96.69% 96.67% -0.02%
==========================================
Files 36 36
Lines 2874 2919 +45
==========================================
+ Hits 2779 2822 +43
- Misses 95 97 +2
Continue to review full report at Codecov.
|
fd0dcd5
to
b5c83c4
Compare
i added a method that performs the index wrangling to embed an operator in a joint hilbert space as defined by a subset of the bases. i'm not sure if this is redundant with the change you added, but i'll work to understand it better. |
b5c83c4
to
2a0e0b3
Compare
I didn't go through your code in detail, so correct me if I'm wrong, but it seems like your function handles the case of a single (composite) operator being embedded in a product basis only. This case is covered by the method I wrote as well. So yes, I think this is a bit redundant. |
Yes, my method handles the case of one operator being embedded in any subspace of a composite hilbert space. so, for 8 qubits, D=2^8, and a CNOT will be embedded appropriately in any 4d supspace, meaning in any 2 indices. I think your method does not distinguish between an operator acting an different, but equivalent, sub-bases. for example, for a 5x3 operator being embedded in a space that is 5x3x3, your method gives the same output whether the indices are [1, 2] or [1, 3], but those should yield different operators. |
so i think my position is as follows: the original code the new method
however, there is an oversight in that it assumes operators in composite spaces correspond to consecutive basis indices. i think it is impossible to correct for this without the index wrangling. Additionally, it assumes the following syntax: the new i think it is true that the more general and bug-free |
c97c568
to
2b2e37a
Compare
2b2e37a
to
d61d107
Compare
i think i have pushed a test-passing working version of what i described. there are a few more tests i'd like to add, but i think the code is at least correct (finally). a review would be much appreciated at this point. |
ff9f6d8
to
c41ced9
Compare
I appreciate all your work. The changes look good and I agree with the new syntax, which makes a lot more sense especially in the case that I oversaw (embedding composite operators on bases such as e.g. [1,3]). I'm also not sure why the tests are failing. Hopefully it was just a hick-up, so I triggered them by closing/re-opening. |
e98773e
to
a514ee7
Compare
* fix ishermitian for dense and sparse operator * Fix manybody deprecated syntax * Change steady state sorting (qojulia#231) * Sort by absolute value of real part * Move normalization and sort by absolute value * Update checking and error message * Fix steady eig docstring formatting * Bump REQUIRE to v0.7-beta2 (qojulia#230) * Bump REQUIRE to v0.7-beta2 * Fix deprecations * Fix deprecations * Remove Compat imports * Change WignerSymbols version * First successful build * Fock tests pass * Some more tests pass * All tests except printing pass * Replace Complex128 with ComplexF64 in tests * Rename Complex128 to ComplexF64 * Add FFTW requirement * Update printing * Add Arpack requirement * Add rounding to printing * Update tests to use 0.7 * Fix compilation deprecation warnings * Fix printing * Fix deprecations * Rename full to dense * Fix some more deprecations * More deprecations * Fix operator deprecations * Fix particle deprecations * Fix all deprecations occurring in tests * Update REQUIRE * Update appveyor * Fix a bug in subspace; export norm * Fix silly bug in subspace * v0.7 compatibility * Implement macros to skip checks commit f221430 Author: david-pl <[email protected]> Date: Fri Aug 17 11:16:22 2018 +0200 Update macro docstrings commit 62f10e8 Author: David Plankensteiner <[email protected]> Date: Tue Aug 14 21:17:58 2018 +0200 Fix stochastic checks commit 5c9eff5 Author: David Plankensteiner <[email protected]> Date: Tue Aug 14 20:45:51 2018 +0200 Rename macros commit f78cf33 Author: david-pl <[email protected]> Date: Tue Aug 14 16:01:36 2018 +0200 Start renaming stuff commit c5f8bd6 Author: David Plankensteiner <[email protected]> Date: Mon Aug 13 20:25:58 2018 +0200 Implement macros to skip checks * Define ' on Operator as dagger (qojulia#235) * fix typo * Enable v1.0 testing * Implement parametric types (qojulia#238) * Start parametric typing for Ket/Bra * Fix tensor vararg for StateVector * Fix subspacebasis field parameters * Fix semiclassical state for kets * Update testing scripts * Fix typo in appveyor * Fix semiclassical_stochastic ket typing * Fix travis 1.0 testing * Parametric typing for CompositeBasis * Rename Operator to AbstractOperator * Proper parametric type for CompositeBasis * Parametric typing for operators * Parametrize basis dimensions * Revert "Parametrize basis dimensions" This reverts commit b451987. * Update basis checks for states * Update basis checks for dense operators * Update basis checks for sparse operators * Update LazyProduct implementation * Update LazySum implementation * Update LazyTensor implementation * Add non-type parameters where needed to ensure correct basis dispatch * Update basis checks for schroedinger * Update basis checks for metrics * Update basis checks for phasespace * Update basis checks for master * Update basis checks for mcwf * Update basis checks for semiclassical * Update superoperators and steadystate * Update basis checks for stochastic solvers * Update timecorrelations basis checks * Added parameter to FFToperators so the gemv! is type stable * Add basis checks to FFT in-place multiplication * Implement transpose forsparse/dense operators * Proper recasting in mcwf * Add some missing basis checks * Fix silly copy-paste error * Less strict typing for liouvillian * Mention gitter in readme text * Some dots for states and operators Squashed commit of the following: commit abc523b Author: david-pl <[email protected]> Date: Fri Jan 11 10:28:33 2019 +0100 Broadcasting for states, operators and superoperators commit 838f717 Author: David Plankensteiner <[email protected]> Date: Sat Dec 8 12:59:47 2018 +0100 Use custom broadcasting styles commit bedef6e Author: David Plankensteiner <[email protected]> Date: Fri Dec 7 11:49:40 2018 +0100 Broadcasting for sparse and dense operators * Fix typo in macro export * Fix @warn and implement adjoint(StateVector) * Update tests to newer Julia versions * Fix documentation of gaussianstate * Patch failing tests * created coherentstate! for inplace operations * Fix bug in MCWF display_afterevent * before embedding check that the destination basis matches the operator basis (qojulia#246) * before embedding check that the destination basis matches the operator basis * Change embed to handle composite operators * perform embedding of an operator in a joint hilbert space * functional embedding with new syntax * more tests for composite bases * code review and a few more tests * Change Int64 to Int in type checks for x86 * remove intersect and union from sortedindices, as there are appropriate methods in Base * Fix default choice of noise for stochastics * Add Bloch-Redfield master equation (qojulia#250) * Added bloch_redfield_master submodule Added the option for a Bloch-Redfield master equation in the timeevolution module * Add files via upload * Delete bloch_redfield_master.jl * Delete QuantumOptics.jl * Update bloch_redfield_master.jl * Cleaned up and commented new bloch_redfield_master submodule * Delete bloch_redfield_master.jl * Moved bloch_redfield_master to correct location... * Re-added coherentstate! (inplace) * Add simple test * Include new test file * Replace vec2mat_index by CartesianIndices * Use timeevolution_base for BR master * Added docstrings and renamed c_ops kwarg to J Changed c_ops kwarg in bloch_redfield_tensor to J to be consistent with Linblad ME implementation * Fix a bug and better saving * Type-stable fout * Fixed docstring typos in bloch_redfield_master * Update README.md * Switch to Project.toml * Update Project.toml * Abstractions for quantum information on qubits (qojulia#251) * created abstractions for quantum information on qubits * changed how equality is handled and added tests * code review * cleanup on types and added tests * code review and composition for chi and ptm * better caching * code review for isapprox vs == * Move windows tests to travis * Improve in-place multiplication for lazy types * Patch bug in mcwf_dynamic * Make entropy_vn type-stable * Update Project.toml * Restrict broadcasting of functions on states and operators * Make bases immutable * use ARPACKException from Arpack.jl * Semiclassical MCWF (qojulia#255) * MCWF jump times and indices (qojulia#257) * semicl mcwf * semicl mcwf läuft * semiclassical mcfw * Change MCWF interface to display jumps * Semiclassical mcwf with display event * Add display_which and display_t to semiclassical mcwf * Clean up integrate_mcwf * Clean up semiclassical mcwf * Add docstrings * Add docstrings in semiclassical.mcwf * Fix tests * Update Project.toml * Remove QuantumOpticsBase functionality (qojulia#259) * Remove QuantumOpticsBase functionality * Re-add changes to mcwf interface lost during deletion * Update semiclassical mcwf docstrings * Fix precompilation * Add superoperator tests that cannot run in Base * Re-add spectralanalysis * Separate stochastic base functionality from timeevolution * Update Project.toml * Type-stable bloch_redfield_tensor (qojulia#262) * Made bloch_redfield_tensor function type-stable * Quick patch failing tests * Install TagBot as a GitHub Action * Update Project.toml Co-authored-by: goropikari <[email protected]> Co-authored-by: David Plankensteiner <[email protected]> Co-authored-by: David Nadlinger <[email protected]> Co-authored-by: Louis Ponet <[email protected]> Co-authored-by: wolfgang-n <[email protected]> Co-authored-by: alexander papageorge <[email protected]> Co-authored-by: sd109 <[email protected]> Co-authored-by: Kristoffer Carlsson <[email protected]> Co-authored-by: Julia TagBot <[email protected]>
closes #240