You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I expected it to support all gates (at least one and two qubit ones) that the statevector supports, probably having this wouldn't be so difficult (especially for one qubit gates, where there is an apply_matrix function for the qubit's tensor).
For two qubit gates there seems that the function apply_2_qubit_gate is able to apply a generic gate matrix, if this is true it shouldn't be so difficult to add all the two qubit gates that are supported by statevector implementation.
How I found out about this:
I tried to compare the results (and the speed, as I expect that my generic simple 'tutorial' implementation to be much slower) with my implementation of MPS with some more or less random circuits and the tests failed with something like:
class std::invalid_argument: MatrixProductState::State::invalid gate instruction 'mcrx'.
If needed, I could try to add those myself, although probably there wouldn't be any optimisation that might be possible for some gates, since I'm not familiar enough with the implementation.
The text was updated successfully, but these errors were encountered:
That is indeed a solution... my problem is that I'm using it from a c++ project and that would mean adding more complexity to it and dependency on code that might change (also I'm not sure if the transpiler is fully implemented in qiskit aer in c++... or in qiskit with some python code mixed in).
Supporting more gates in a particular simulator - and having a larger common set supported by them - seems not a bad ideea, anyway.
It appears that apply_unitary and apply_diagonal_matrix should work at least for one and two-qubit gates (the three qubit ones I need I can transpile to one and two-qubit gates circuits).
For the gates that are not supported I can provide myself the matrices to those calls.
I'm closing this as solved since this solves it for me... although still supporting a larger common set of gates would be nice.
What is the expected behavior?
I expected it to support all gates (at least one and two qubit ones) that the statevector supports, probably having this wouldn't be so difficult (especially for one qubit gates, where there is an
apply_matrix
function for the qubit's tensor).For two qubit gates there seems that the function
apply_2_qubit_gate
is able to apply a generic gate matrix, if this is true it shouldn't be so difficult to add all the two qubit gates that are supported by statevector implementation.How I found out about this:
I tried to compare the results (and the speed, as I expect that my generic simple 'tutorial' implementation to be much slower) with my implementation of MPS with some more or less random circuits and the tests failed with something like:
If needed, I could try to add those myself, although probably there wouldn't be any optimisation that might be possible for some gates, since I'm not familiar enough with the implementation.
The text was updated successfully, but these errors were encountered: