Skip to content
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

Multislice ptychography with mixed state probe? #523

Closed
Kylee-iem opened this issue Sep 20, 2023 · 3 comments
Closed

Multislice ptychography with mixed state probe? #523

Kylee-iem opened this issue Sep 20, 2023 · 3 comments
Assignees

Comments

@Kylee-iem
Copy link

Hello,
I have a question about the ptychography. Could you please tell me whether there is function to use the multislice ptychography with mixed state probe? I cannot find the function in the py4DSTEM tutorials.
Thanks in advance.

@gvarnavi
Copy link
Member

Hello @Kylee-iem,

Indeed, that functionality was not yet supported (mostly out of laziness, and since we're thinking of revamping the ptycho infrastructure soon which would affect all classes).

However, you were not the only person to ask for this functionality, so I went ahead and implemented it real quick. This is now pushed in the phase_contrast branch* and can be called as:

py4DSTEM.process.phase.MixedstateMultislicePtychographicReconstruction(
    datacube=dataset,
    num_probes=2,
    num_slices=6,
    slice_thicknesses=slice_thicknesses,
    ...
)

Hopefully the arguments you expect reconstruct to have for both multi-slice and mixed-state should all be supported, but I only did some rudimentary testing on this using the tutorials here and here, so I suspect there could be bugs. If you find any, please report them here.

Finally, note that under the current paradigm - the implementation is vectorized, meaning the propagated probes inside the forward model are stored with dimensions (num_slices, batch_size, num_probes, region_of_interest_shape[0],region_of_interest_shape[1]) which might lead to memory issues on the GPU. This should hopefully be alleviated in the upcoming restructuring, where we're hoping to switch to a streaming data model.

* You will need to set-up a dev environment to try this out before the next release using something like:

git clone https://github.com/py4dstem/py4DSTEM.git
cd py4DSTEM
git checkout phase_contrast
pip install -e .

@sezelt
Copy link
Member

sezelt commented Sep 26, 2023

I tried it on some of my experimental data and it seems to behave correctly

@gvarnavi
Copy link
Member

Great, thanks for testing @sezelt!
Closing as PR #539 should include this in dev/next release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants