Hi @Razeen ud-Din / PhD Scholar
Thank you for reaching out to the Microsoft Q&A platform.
The Python and Q# runtime environments are largely separate, and Q# can’t just “see” variables or values defined in Python (and vice-versa).If you want to pass values from Python to Q#, you must evaluate a Q# expression which embeds those values, such as defining a Q# operation with those values within it or calling a Q# operation passing the values as arguments.
It’s not the most elegant, but the most common types that need to be passed (e.g. numbers and lists of numbers) have the same text representation in both languages.
We are working on better docs & samples for this. For now, one of the clearest (though not very brief) examples is our DF Chemistry sample. For example, see the code at this line: https://github.com/microsoft/qsharp/blob/main/samples/estimation/df-chemistry/chemistry.py#L479
Let me know if that helps of you have further questions.
If I have answered your query, please click "Accept as answer" as a token of appreciation