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

MPSStateSpace and MPSSimulator are not compatible with StateSpace and Simulator #395

Closed
jaeyoo opened this issue Aug 4, 2021 · 1 comment · Fixed by #437
Closed

MPSStateSpace and MPSSimulator are not compatible with StateSpace and Simulator #395

jaeyoo opened this issue Aug 4, 2021 · 1 comment · Fixed by #437

Comments

@jaeyoo
Copy link
Contributor

jaeyoo commented Aug 4, 2021

We saw that MPSSimulator doesn't work with a function due to lack of a definition:

  • ApplyFusedGate() : gate_appl.h
    • fp_type is not defined in MPSSimulator
In file included from tensorflow_quantum/core/ops/math_ops/tfq_simulate_mps_1d.cc:20:
external/local_config_tf/../qsim/lib/gate_appl.h: In instantiation of 'void qsim::ApplyFusedGate(const Simulator&, const Gate&, typename Simulator::State&) [with Simulator = qsim::mps::MPSSimulator<const tfq::QsimFor&, float>; Gate = qsim::GateFused<qsim::Gate<float, qsim::Cirq::GateKind> >; typename Simulator::State = qsim::mps::MPSStateSpace<const tfq::QsimFor&, float>::MPS]':
tensorflow_quantum/core/ops/math_ops/tfq_simulate_mps_1d.cc:165:59:   required from here
external/local_config_tf/../qsim/lib/gate_appl.h:139:11: error: no type named 'fp_type' in 'class qsim::mps::MPSSimulator<const tfq::QsimFor&, float>'
  139 |     using fp_type = typename Simulator::fp_type;
      |           ^~~~~~~

Also, MPSStateSpace doesn't work with some functions due to different names:

  • tfq::ComputeExpectationQsim()
    • StateSpace::Copy() vs MPSStateSpace::CopyMPS()
    • StateSpace::SetZeroState() vs MPSStateSpace::SetMPSZero()
    • StateSpace::RealInnerProduct() vs MPSStateSpace::lnnerProduct()
This was referenced Aug 4, 2021
@jaeyoo
Copy link
Contributor Author

jaeyoo commented Aug 5, 2021

StateSpace::SetZeroState() should be StateSpace::SetStateZero()

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

Successfully merging a pull request may close this issue.

1 participant