quantum icon indicating copy to clipboard operation
quantum copied to clipboard

qsim path is weird

Open jaeyoo opened this issue 4 years ago • 3 comments

Let's investigate why this happens:

#include "../qsim/..."

and if it is possible that:

#include "qsim/..."

jaeyoo avatar Jun 21 '20 06:06 jaeyoo

This might have to do with: https://github.com/quantumlib/qsim/issues/69

MichaelBroughton avatar Jun 22 '20 19:06 MichaelBroughton

This issue has not had any activity in a month. Is it stale ?

github-actions[bot] avatar Sep 01 '20 00:09 github-actions[bot]

I figured out what's going on the weird path. In bazel, it's creating the temporary cache directory path bazel_{project_name}. For example, for tensorflow quantum, it has quantum as project name, so it creates bazel_quantum directory. Inside it, it collects the whole dependency library path as well as tensorflow_quantum itself. So, in the directory, we can observe:

  • tensorflow_quantum
  • qsim

so to access the qsim directory, we need to use ../ as prefix.

To make the qsim itself as default include path, like #include "qsim/", we can use the bazel's cc_library(includes = ["PATH"]) option. To do that, we may re-organize qsim directory structure. For example, add qsim directory, and put lib directory under it, then we can use #include "qsim/lib/...".

Let me prepare a PR to fix this, and maybe this will be a starter for migrating qsim to full bazel supports as mentioned in https://github.com/quantumlib/qsim/issues/69

jaeyoo avatar Apr 13 '23 06:04 jaeyoo