Slot extraction in BFV or CKKS

Hi everyone, is there any way to extract a slot of a PackedCiphertext in CKKS or BFV ? I mean the result will NOT be a PackedCiphertext.
More generally, is it possible to correspond a PackedCiphertext of n-slot to n Ciphertext of 1-slot efficiently ?

Thank you

If your goal is to get a 1-slot CKKS or BFV ciphertext, the typical way to extract a single slot is to multiply it by a binary mask, i.e., a plaintext created from a vector, where 1 corresponds to the desired slot and all other slots are 0’s. You can then rotate the result if you want to get the desired value at the first slot.

If you want to combine multiple 1-slot ciphertexts, you can use the built-in EvalMerge function. It converts a vector of ciphertexts with the values in the first slots into a single ciphertext with slots ordered the same way as the ciphertexts in the input vector.