-
Notifications
You must be signed in to change notification settings - Fork 186
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
Add n-mode gaussian transformation gate in TFbackend #599
Conversation
Can not pass the tests because it can not import the function from TW for now. |
Co-authored-by: Theodor <theodor.isacsson@gmail.com>
idl = tf.eye(2 * m, dtype=dtype) | ||
Rot = tf.cast(tf.math.sqrt(0.5), dtype=dtype) * tf.concat( | ||
[tf.concat([idl, 1j * idl], 1), tf.concat([idl, -1j * idl], 1)], 0 | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the Rot
matrix should be available in TW somewhere (@nquesada). Also, perhaps we can avoid creating a new one each time?
) | ||
sigma = Rot @ choi_cov @ tf.transpose(tf.math.conj(Rot)) | ||
zh = tf.zeros([2 * m, 2 * m], dtype=dtype) | ||
X = tf.concat([tf.concat([zh, idl], 1), tf.concat([idl, zh], 1)], 0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This too I believe is in TW
* Lift TF installation assumption from frontend tests * Update changelog * Refactor mock TensorFlow imports * Run black formatter * Remove isolated .backend artefact from merge * Use sf.LocalEngine() in frontend tests and gate TF version tests * Restore test coverage to incorrect TF version check * Restore TFBackend import to bottom of file * Fix TF imports in frontend tests following #599 * Remove release note about TF test fixes
This is the work to add an n-mode gaussian transformation gate (class Ggate) basing on TFbackend, with my supervisor @ziofil and with the help of @nquesada.
The main idea is to create the n-mode gaussian gate from its (S,d) parameters [Symplectic matrix and displacement vector] to its (C, mu, Sigma) parameters and then get the matrix of gate recursively.
[Warning:]
This gate has a special optimizer.
This gate haven't finished the decomposition part.